Thanks Eric, I'll use this to explore the issue. I suspect the issue is indeed around sockets, I found a reply from you from a while back that seems to point on memcache as another thing I need to manage at the worker level: http://rubyforge.org/pipermail/mongrel-unicorn/2010-January/000309.html
That being said, I'm extremely surprised there is no published unicorn startup scripts that consider the common use case of a deployment stack that includes: Rails + Active Record Redis Memcache I'll post my final script once I conclude the investigation. Best Regards, Avner Cohen On Sun, Jan 20, 2013 at 11:17 AM, Eric Wong <[email protected]> wrote: > Avner Cohen <[email protected]> wrote: >> Eric, >> Thanks for the quick reply, and aplogies for not providing full info. >> I do have these set up, here is my full configuration: >> >> # -*- encoding : utf-8 -*- >> worker_processes 4 >> working_directory "." >> listen 3000 >> timeout 120 >> >> preload_app true >> >> before_fork do |server, worker| >> defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! >> end >> >> >> after_fork do |server, worker| >> defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection >> end > > Interesting. I haven't kept up with changes in Rails over the > past few years. Hopefully somebody else on the list, has... > > Which database and adapter are you using? > > Do you have anything else that opens a socket at application startup? > (e.g. memcache, redis, ..., especially anything that would interact > with ActiveRecord/Model) > > Can you try just using one worker_process + preload_app=true and > doing "lsof -p" on both the PID of the master and single worker > to show open sockets (and any other FDs which may be inadvertantly > shared)? > > The only stream socket which should be shared are the listeners. _______________________________________________ Unicorn mailing list - [email protected] http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
