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

How much memory should be allocated to memcache on a small EC2 intance (1.7 GB RAM). The OS is Ubuntu Hardy.


share|improve this question
There's no way anyone can answer this, you've given us no information about what your server's doing or what you're trying to achieve. – Chopper3 Apr 23 '10 at 21:26
@Chopper3 I am new to this so not sure what other information needs to be provided but I will try. Memcache is installed so then it will cached sql queries instead of the app quering the database. Memcache will be used by three applications, our main app, Wordpress and OpenX. We will not be running a seperate memcached server but the apache-app role on EC2 have memcache installed. Please let me know if more information is needed. Thanks. – April Apr 23 '10 at 22:13
Have you first enabled the built-in MySQL query cache? Adding memcached on a single, multi-purpose 1.7GB instance may do more harm than good, if it reduces the RAM for MySQL. – ceejayoz Apr 9 '12 at 19:54
up vote 3 down vote accepted

You can approach this in two different ways...

  1. Find out how large each object is that you will be caching and then calculate how many of each object you think you will be caching. From there, do the math and add some headroom (1/3 or 1/2 extra).

  2. (My recommendation in this very simplistic use case) Alternatively, you can just create an instance and monitor the total number of bytes that are in the memcached over time and increase the size as necessary. There are many tools available that will provide memcached statistics do do this.

FYI, pedantic, I know, but the product is "memcached" not "memcache" and you will have better results in your searches if you keep that in mind.

share|improve this answer
@Abrown Thanks for this. Could you recommend any tools to monitor and analyse memcached statictics? – April Apr 25 '10 at 10:50
Hyperic will keep track of them and give you nice pretty graphs. If you just want to see stats, there is always… – Aaron Brown Apr 26 '10 at 20:42

PhpMemcachedAdmin ( is a great tool for monitoring your memcached instances. By watching the evictions rates you should get a feel for whether you are running into problems with the expiration.

share|improve this answer

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.