[Ruby] memcache-client advice
Eric Hodel
drbrain at segment7.net
Sat Apr 21 13:51:49 PDT 2007
Please don't top-post.
On Apr 20, 2007, at 15:55, James Hillyerd wrote:
> As a followup, I spent some time playing with memcache-client 1.3.0
> in irb today with a couple memcached servers.
>
> It seems to be the library is fault tolerant of memcached's exiting.
> But if I suspend a running memcached (Ctrl-Z), CACHE.get will hang
> for at least a few minutes... I gave up waiting.
>
> I'm not familiar with socket programming... Is there a timeout that
> could be set somewhere to force it to give up if the TCP conn hangs
> for a few seconds?
Currently only socket connection is wrapped in a timeout. After that
the socket is left open. Every socket access used to be wrapped in a
block for mutual exclusion, but I've removed the blocks because it
chewed up a significant amount of the time spent in the client.
I don't think I'll be adding another block invocation to the code,
but adding a call to #select on the socket to check for writability
in #cache_get might help.
More information about the Ruby
mailing list