Redis Command Statistics Test

Redis commands that clients issue on the target Redis server can sometimes hog server resources. Consequently, server performance may suffer. To avoid this, administrators need to track how much CPU is consumed by each command, identify the resource-intensive commands, and see how to re-engineer the client applications so as to reduce the usage of such commands. The Redis Command Statistics test helps with this!

This test auto-discovers the commands running on the Redis server and reports the number of times each command was called. Additionally, the test reports the total and average CPU time consumed by every command. By quickly comparing the CPU consumption across commands, you can quickly identify the command that is hogging the server resources.

Target of the test :A Redis server

Agent deploying the test : An internal agent (recommended)

Outputs of the test : One set of results for every Redis command

Configurable parameters for the test
Parameters Description

Test period

How often should the test be executed


The host for which the test is to be configured.


The port at which the specified HOST listens.

Redis Password and Confirm Password

In some high security environments, a password may have been set for the Redis server, so as to protect it from unauthorized accesses/abuse. If such a password has been set for the monitored Redis server, then specify that password against REDIS PASSWORD. Then, confirm the password by retyping it against CONFIRM PASSWORD.

If the Redis server is not password protected, then do not disturb the default setting of this parameter.

To determine whether/not the target Redis server is password-protected, do the following:

  • Login to the system hosting the Redis server.

  • Open the redis.conf file in the <REDIS_INSTALL_DIR>.

  • Look for the requirepass parameter in the file.

  • If this parameter exists, and is not preceded by a # (hash) symbol, it means that password protection is enabled for the Redis server. In this case, the string that follows the requirepass parameter is the password of the Redis server. For instance, say that the requirepass specification reads as follows:

    requirepass red1spr0

    According to this specification, the Redis server is protected using the password red1spr0. In this case therefore, you need to specify red1spr0 against REDIS PASSWORD.

  • On the other hand, if the requirepass parameter is prefixed by the # (hash) symbol as shown below, it means password protection is disabled.

    # requirepass red1spr0

    In this case, leave the REDIS PASSWORD parameter with its default setting.

Measurements made by the test
Measurement Description Measurement Unit Interpretation

Average CPU time per command execution

Indicates how much CPU time was used by a single call of this command.


Compare the value of this measure across commands to know which command has been consistently over-utilizing CPU resources.

Total number of calls

Indicates the number of times this command was called.



Total CPU time consumed

Indicates the total CPU time used by this command.


If this measure reports an abnormally high value for any command, it implies that that command is hogging CPU resources.

However, before branding the command as 'expensive', you must try to ascertain whether the command steadily hogs CPU or sporadically. For that, take a look at the value of the Average CPU time per command execution measure for that command. If the Average CPU time per command execution measure reports a very high value for that command, you can conclude that the command is indeed CPU-intensive. On the other hand, if the Average CPU time per command execution measure reports a low value for the command, then you can attribute the high CPU usage of the command to one or all of the following:

  • If the command had been called numerous times during a short period, then the overall CPU usage may increase. So, it would make sense to keep an eye on the value of the Total number of calls measure to determine how many times the command was called.

  • If the command had consumed CPU excessively during very few of its executions, the overall CPU consumption of the command will increase, without impacting the average consumption of the command.