Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small cluster of servers balancing a Java web app. Currently I have 3 memcached servers caching data and all web apps shares all 3 memcached instances.

I often get strange slowdowns and timeouts to some of the memcacheds and I wondering if there is a good way of analyzing the performance.

I am wondering whether my iptables rules (or some other system limitation) are blocking/slowing connections. I am considering reconfiguring the web apps so that they only query the memcached process on their own localhost.

share|improve this question

migrated from Nov 26 '11 at 10:59

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

You can find some cacti templates for memcached here One thing you will want to look at is the number of connections allowed by memcached, by default set to 1024. You can see the relevant section of the documentation here If your client isn't properly closing connections this can cause symptoms like slowdowns.

Moving to local only memcached you will probably run into issues with cacheing, because everyone knows there are only two hard problems in CS, cache invalidation and naming things.

share|improve this answer
More Cacti Memcached templates and Zabbix Memcached Templates. Measuring is the key to understanding what your servers are doing. – Ladadadada Nov 28 '11 at 20:37

These things depend on various factors. Obviously, querying a remote memcache is slower than querying a local memcache. So if you have enough memory to keep a reasonable amount of data in the cache, better keep a copy on each. Make sure the memcaches don't use the swap memory.

And think about when it is cheaper to wait for a (potentially slow) remote memcache or just recompute the data.

share|improve this answer
Thanks @Anony-Mousse: is there a way to configure memcached on CentOS to never use swap memory? – Nic Cottrell Apr 12 '15 at 12:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.