Per this documentation:
Socket connections continue to be shared after a Smart spawn operation. The example listed is for Memcached.
Does one have to similarly reconnect ActiveRecord in this case as well? Something like:
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
# We're in smart spawning mode.
ActiveRecord.establish_connection(...)
else
# We're in conservative spawning mode. We don't need to do anything.
end
end
passenger automatically reestablishes the connection to the database upon creating a new worker process, according to the guide, so you shouldn't have to do that.
Are you experiencing any trouble that would lead you to believe this might not be the case?