How much memory should be allocated to memcache

memcache

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

Thanks.

Best Answer

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.