Memcached gem issue with passenger getting MemcachedClientError
I have recently migrated my code from Rails 2.3.4 to rails 3 and started using passenger with it. I am also using memcached gem and i randomly see Memcached::ClientError and Memcached::ServerIsMarkedDead. I have read this article which says passenger smart spawning has issues with memcache socket based connect. So i tried the fix mention on their site
CACHE = MemCache.new memcache_options
CACHE.servers = '127.0.0.1:11211'
begin
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
# We're in smart spawning mode, so...
# Close duplicated memcached connections - they will open themselves
CACHE.reset
end
end
# In case you're not running un开发者_StackOverflowder Passenger (i.e. devmode with mongrel)
rescue NameError => error
end
But still i get the same error. has it got something to do with the memcached library
I run a Rails 3.1.3 app on Ubuntu with memcached, I am using the Dalli gem to interface with it, not a single glitch so far. You might want to look into that. Dalli Gem on GitHub
精彩评论