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
http://unicorn.bogomips.org/examples/unicorn.conf.rb
In the after_fork you want:
Rails.cache.reset
or if you're using an older version of the memcache gem (i.e. you're not
using the dalli gem which I highly recommend) you may need this hack:
if Rails.cache.is_a?(ActiveSupport::Cache::MemCacheStore)
Rails.cache.instance_variable_get(:@data).reset
end
If you use the UUID gem you need this in your after_fork:
UUID.generator.next_sequence
As for redis:
https://github.com/redis/redis-rb/blob/master/examples/unicorn/unicorn.rb
Cheers,
Lawrence
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying