You have been using Memcached for some time, your web app works well, and your hit rate is decent. Recently, your traffic has grown, or maybe your app’s complexity has increased, so you decided to cache more, e.g., user sessions or page fragments, to make your app even speedier.

After deploying the app with improved caching, the app still works as expected, and the hit rate is still decent. So how do you know your new caching strategy is working and these new items are indeed being cached effectively?

Overall cache metrics are limited

You look at your standard Memcached metrics, but unfortunately, they cannot tell you much. Unless there is a drastic change in hit rate, these metrics tell you at most that you are caching more than before. Especially the hit rate, the primary measure of performance, only tells you about overall cache performance.

To determine if changes to your caching strategy are working, you would need to know the hit rate of the items you just started to cache. This is where the CacheSight dashboard for your Memcached can help.

Understand the individual performance of each aspect of your cache

CacheSight’s Introspection feature allows you to monitor a group of keys by watching a prefix. For example, say the keys for your cached sessions start with session_. You can watch the prefix session_ to see the performance of your session caching. CacheSight will tell you what fraction of your cache is preoccupied with a given prefix and, more importantly, what hit rate it has. A low hit rate can indicate an implementation problem.

In essence, CacheSight takes the guesswork out of your caching strategy. No matter how many things you cache; pages, views, templates, sessions, expensive database queries, expensive computations, slow queries to external services, and so on, CacheSight can tell you the individual performance of each aspect of your caching implementation.

A more meaningful hit rate

We recommend you aim at a hit rate of 80% or above for your overall cache performance since real-world events are generally Pareto distributed (80-20 rule). This is just a very rough guestimate because, depending on what you cache, a wide range of hit rates might be acceptable.

With CacheSight evaluating what good cache performance should look like can be determined on a much more granular level. A hit rate below 60% for your cached views might be unacceptable, while a session counter with a hit rate of 20% might be normal.

CacheSight works with any Memcached on AWS, including ElastiCache for Memcached. Get started for FREE today and rest easy knowing your Memcached strategy is working successfully.