Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Thanks.

share|improve this question
1  
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
1  
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
add comment

2 Answers

up vote 2 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 code.sixapart.com/svn/memcached/trunk/server/scripts/… –  Aaron Brown Apr 26 '10 at 20:42
add comment

PhpMemcachedAdmin (http://code.google.com/p/phpmemcacheadmin/) 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
add comment

Your Answer

 
discard

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.