Problem with memcached gem with passenger receiving MemcachedClientError

I recently migrated my code from Rails 2.3.4 to rails 3 and started using a passenger with it. I also use memcached gem and I accidentally see Memcached :: ClientError and Memcached :: ServerIsMarkedDead. I read this article which says that passenger smart spawning is having trouble connecting with memcache. So I tried to fix the mention on my 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 under Passenger (i.e. devmode with mongrel)
rescue NameError => error
end

But still I get the same error. Does it have anything to do with the memcached library.

+3
source share
1 answer

Rails 3.1.3 Ubuntu memcached, Dalli, , . . Dalli Gem GitHub

+1

All Articles