Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional "No servers available" error from MemCache #1

Open
jszmajda opened this issue May 5, 2011 · 1 comment
Open

Occasional "No servers available" error from MemCache #1

jszmajda opened this issue May 5, 2011 · 1 comment

Comments

@jszmajda
Copy link

jszmajda commented May 5, 2011

Hello, thanks for writing a supremely useful library!

It works most of the time, but once in a while we get a "No servers available" message from the MemCache client. I'm not sure what could cause this. We're connecting to the memcache servers just fine from Rails proper, but MegaMutex still has trouble.

We're using Passenger, so I thought it could've been an issue with forking, but I can't seem to find any correlation between forking and the error.

Any ideas?

Thanks!
-Josh

@nfelger
Copy link

nfelger commented May 9, 2011

Hi Josh,

The error you get comes directly from memcache-client (see Memcache#get_server_for_key at https://github.com/mperham/memcache-client/blob/master/lib/memcache.rb), and is raised when the server list is configured to be empty or none of the servers can be connected to. The fact that this only happens intermittently suggests that you are probably experiencing connection issues some of the time.

This could have a number of reasons, and as you suggested, these are also the symptoms of passenger's "smart"/"smart-lv2" spawning method, as described at http://www.productionhacks.com/2010/04/15/memcached-and-passenger-connection-sharing/. We are not using smart spawning ourselves though, so I can't be sure. Can you try running one of your instances with passenger_spawn_method set to conservative?

(Note that the patch described on the link above won't work for MegaMutex as it's not sharing connections with the various Rails caches. You could probably devise a similar solution though.)

niko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants