The redis-cli --latency -h -p is a tool to help you troubleshoot and understand the latency issues you may be experiencing with Redis. It does this by measuring the time that the Redis server responds to the Redis PING command in milliseconds.
In this context, the delay is the maximum delay between the client issues the command and the response time of the response to the client command. Typically, Redis processing time is extremely low, microseconds, but there are certain conditions that lead to increased latency.
- Redis Latency Troubleshooting
So, when we run the redis-cli --latency -h 127.0.0.1 -p 6379 command, Redis enters a special mode in which it continuously processes the delay (by running PING).
Now let's break down what data it returns: min: 0, max: 15, avg: 0.12 (2839 samples)
What (2839 samples) ? This is the number of times a redis-cli issued a PING command and received a response. In other words, these are your sample data. In our example, we recorded 2839 requests and responses.
What is min: 0 ? The min value represents the minimum delay between the CLI PING release time and the response time. In other words, it was the absolute best response time for our data.
What is max: 15 ? The value of max opposite of min . It represents the maximum delay between the CLI PING release time and the command response time. This is the longest response time of our data. In our example, out of 2839 samples, the longest transaction took 15ms .
What is avg: 0.12 ? The avg value is the average millisecond response time for all of our data. So, on average, from our 2839 samples, the response time took 0.12ms .
Basically, higher numbers for min , max and avg are a bad thing.
Some good materials on how to use this data: