Troubleshooting connection problems with memcached

I was noticing today many apache segfaults on this server, and pretty high traffic loads at times. I haven't pinpointed the exact cause of high traffic, there are a couple candidates, but the apache segfaults seem to accompanied by the following PHP errors:

[13-Aug-2008 13:55:27] PHP Notice:  MemcachePool::get() [memcachepool.get]: Server 127.0.0.1 (tcp 11211, udp 0) failed with: Network timeout (0) in /var/vhosts/oam/soccerblogs.net/inc/Db/Slopject/Collection.php on line 579
[13-Aug-2008 13:55:29] PHP Notice:  MemcachePool::get() [memcachepool.get]: Server 127.0.0.1 (tcp 11211, udp 0) failed with: Network timeout (0) in /var/vhosts/oam/soccerblogs.net/inc/Db/Slopject/Collection.php on line 579

This may be related to the local firewall and ip_conntrack, which has a known problem with memcached

> This is because kernel try to track all your memcached connections - ie watch > all tcp/ip connection that you made to your memcache. and because conntrack > table have a limited size , and it must hold a connection information for > relative long time, when this table get overloaded, packets are dropped .

The required iptables rule in that email isn't quite right, I had to do the following on the server

iptables -t raw -I OUTPUT  -s ip_addrsss of your memcached box --protocol tcp --sport port of your memcached daemon   -j NOTRACK

Here may end my brief fling with memcached. I'd originally installed it after switching to using prepared SQL statements, which do not use mysql's query cache. I suspect mysql's query cache is better for local caching, as it may allow mysql to handle client requests much faster. As it is now, mysql is taking more time to do its work, which at some point, knocks memcached offline. For local caches, using the caching mechanism available through php accelerators such as eaccelerator may be a better option to running a local memcached

Tags: ,

Related Items

I ran into SSL timeouts on in local development setup when I was re-factoring...
Add it to your aliases, this one liner adds all unrecognized files in the...
The script below does the same and only depends on mutt (or another command...
At home, we were missing the ability to print from our iPad or iPhones. While I...
Finally. This is a huge step forward for Drupal. After eschewing OOP practices...
I came across this link about a Virginia Tech professor that wrote a program to...

Comments

Subscribe by Email

Enter your email address:

Delivered by FeedBurner