Memcached on Solaris
If you observe memcached exhibiting strange behavior while running under Solaris, you should try upgrading to the latest version of libevent.
I experienced a problem while testing my application on the excellent Joyent Facebook Accelerator, which runs Solaris Nevada snv_67 X86, has memcached 1.2.2 with libevent 1.3b2 installed by default.
My memcached usage is pretty low and I refresh the cache often to keep it from going stale, but somehow I still get lots of cache misses. By elimination, I ruled out the possibility of faults on the python memcache module, or memcached version (tried the latest 1.2.4 compiled against the libevent-1.3b2 and it still had the same problem.) When I connected my app to the memcached instance running on my FreeBSD box, though, the problem doesn’t exist.
Eventually, it turns out that memcached disconnects the client and all I got from the python memcache module was:
File "/opt/local/lib/python2.5/site-packages/memcache.py", line 846, in recv
'read returned 0 length bytes' % ( len(buf), foo ))
Well, that’s another bug. The above foo should really be rlen, but fixing that only proved that memcached always disconnects the client after sending 66887 bytes in response to a get.
After some poking around (by inserting prints and running memcached in foreground mode), it was apparent to me that memcached was getting an error from libevent, so I upgraded libevent and problem was solved.
Hope this helps anyone who may run into the same problem (as I couldn’t find any clue in the googs.)
Related posts:
- Python 3.0: Text vs. Data Instead Of Unicode vs. 8-bit Python 3.0 (Py3K) is out. I’m with Sam Ruby — this seemingly simple change of paradigm from “Unicode vs. 8-bit”...
- web.py with mod_python on Apache Normally, I’m a Django-head, but today I wanted a quick way to write a small web app and have heard...
- Using XML-Stream without Encode.pm I needed to write a notification script for AMMS, so that a mail server administrator can be notified by IM...
- BugMeNot.com down I can no longer access the site to get my free passwords. Did a quick DNS check: ns1.bugmenot.com and ns2.bugmenot.com...
- mod_python OpenID Access Control Since XRI is pretty much in bed with OpenID and NeuStar is an XRI shop, I get to play around...
Related posts brought to you by Yet Another Related Posts Plugin.