Key metrics to monitor in Redis and optimization settings

Hi everyone in our last post we talked about Redis monitoring using Prometheus and Grafana. When I posted this on a few forums I got a suggestion that I should write about key metrics to watch while monitoring Redis. So let’s start the article Key metrics to monitor in Redis and optimization settings.

Below are key metrics that you have to think about. These metrics you can find using the article mentioned above and this dashboard in Grafana.

Key metrics to monitor in Redis and optimization settings

Memory Usage

Redis is an in-memory database so the first thing that you have to worry about is the amount of RAM that your server will use. Once you see your Redis getting your RAM filled up you can see performance impacts so it is recommended to always leave some amount of RAM for your system. You can do that by using the maxmemory setting. Always give 90 percent or 500mb memory to your Redis and leave 10 percent to the system. You can do it using redis-cli

config set maxmemory 12200

This is also very important as the key evictions depend on max-memory. If your maxmemory is not set, your mays may not get evicted. You can read it here.


You also have to keep track of hit and misses if your misses increase a lot you can say there is something wrong. Also if you also using Redis as cache you must be aware that cache misses are more costly then getting the actual data.

Expiring vs non-expiring keys.

These are the keys that expire and some that don’t expire. The combination of maxmemory, eviction policy and expiry of keys decide which keys will be expired. If the keys are not getting expired your whole memory may be consumed and if eviction is not on max memory new keys will not be inserted in Redis.

Network IO

This defines what is the bandwidth as in how many parallel calls to Redis the network can handle. This generally will not be a bottleneck.

Other metrics

Next, you can keep a watch on how many clients are connected. High number of clients can be a problem. Then comes a number of commands getting executed.

Optimized settings for Redis.

Here are a few settings that you can do on your Redis node to make them perform better.

Increase somaxconn

echo 1204 > /proc/sys/net/core/somaxconn

VM overcommit

This is important if you are taking backup of Redis and the memory present on the system is less than what Redis is running on. You can set it using the below command. Note this is not a recommended setting for normal systems.

echo 1 > /proc/sys/vm/overcommit_memory

Transparent Huge Pages

This setting slows down the databases that use memory so to set it. You can run the below command.

echo never > /sys/kernel/mm/transparent_hugepage/enabled

These are some basic settings that you can do to make your Redis perform better.

If you like the article please share and subscribe. Also please suggest what other things you want to hear about.

Gaurav Yadav

Gaurav is cloud infrastructure engineer and a full stack web developer and blogger. Sportsperson by heart and loves football. Scale is something he loves to work for and always keen to learn new tech. Experienced with CI/CD, distributed cloud infrastructure, build systems and lot of SRE Stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.