Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 under 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

like image 944
Rima Avatar asked Jul 31 '26 16:07

Rima


1 Answers

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

like image 200
KKK Avatar answered Aug 03 '26 09:08

KKK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!