Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26652

How to improve memcache hitrate?

Memcache reports a hit ratio in gae to 32%. I don't know how good that is. Should I try and improve or how do I measure whether this hit ratio is ok? I suppose now that I see that memcache actually does make hits and misses I can try to improve the hit ratio.

Statistics Hit count:   2490
Miss count:     5206
Hit ratio:  32%
Item count:     2006 item(s)
Total cache size:   3632355 byte(s)
Oldest item age:    6 hour(s) 4 min(s) 23 second(s) 

Update

After careful refactoring I've managed to improve hitrate to 40 %.

Upvotes: 1

Views: 4158

Answers (1)

user1596371
user1596371

Reputation:

Given that your cache size is not even 4MB I would suggest that your cache isn't holding a lot of objects. Chances are that either your cache is still warming up or you are expiring things too quickly for it to take effect.

You could try increasing the life of items in the cache and see if that helps, although given your overall access numbers I suspect that it's just a case of memcached not being asked to do a lot.

Upvotes: 2

Related Questions