Redis Client Details Test

Redis accepts clients connections on the configured listening TCP port and on the Unix socket if enabled. When a new client connection is accepted the following operations are performed:

  • The client socket is put in non-blocking state since Redis uses multiplexing and non-blocking I/O.

  • The TCP_NODELAY option is set in order to ensure that there are no delays in connections;

  • A readable file event is created so that Redis is able to collect the client queries as soon as new data is available to be read on the socket.

Sometimes, by issuing a blocking command, users may block client connections. Usually the reason to block is that we expect some external event to happen: this can be some change in the Redis data structures like in the BLPOP case, a long computation happening in a thread, to receive some data from the network, and so forth. If many clients are unable to connect to the server, administrators must be able to determine if it is because of blocking commands.

Also, Redis allocates an input buffer for each client, and its role is to temporarily save the commands sent by the client. Redis requires that the size of this input buffer does not exceed 1GB, as otherwise, the client may be shutdown. Administrators therefore must be proactively alerted if any client has an input buffer that is of a size greater than 1GB.

Moreover, Redis needs to handle a variable-length output buffer for every client, since a command can produce a big amount of data that needs to be transferred to the client. If this buffer is not correctly sized, then it can fill up quickly, causing subsequent responses to clients to be enqueued in an output list. If this output list is very long for any client, it is a sign that the output buffer needs resizing. Administrators must monitor the length of the output list of clients, so that they can be instantly alerted if any client's output list is abnormally long.

Using the Redis Client Details test, administrators can do all of the above! This test monitors client connections to the Redis server and captures blocked connections. This way, administrators can confirm if connections being blocked (probably by blocking commands) is the reason why clients are unable to the connect to the server. The test also monitors the size of the input buffers of clients and the output list of clients and reports the size of the largest buffer and the length of longest output list. In the process, the test reveals whether/not input and output buffers are properly sized, thereby prompting administrators to fine-tune them.

Target of the test :A Redis server

Agent deploying the test : An internal agent (recommended)

Outputs of the test : One set of results for the monitored Redis server

Configurable parameters for the test
Parameters Description

Test period

How often should the test be executed

Host.

The host for which the test is to be configured.

Port

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.

Max Clients

By default, the detailed diagnosis of the Total number of connected clients measure reports the details of a maximum of 20 clients only. If you have a well-sized eG database, you may want to have detailed diagnostics display the details of more number of clients. In this case, you can increase the value of this parameter. On the other hand, if you want to conserve eG database space, then you can detailed diagnostics display the information related to the a lesser number of clients. In this case, set a value lower than 20 for the Max Clients parameter.

Detailed Diagnosis

To make diagnosis more efficient and accurate, the eG Enterprise suite embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

  • The eG manager license should allow the detailed diagnosis capability
  • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Total number of connected clients

Indicates the total number of client connections to the target server (excluding connections from slaves).

Number

Use the detailed diagnosis of this measure to know which clients are connected to the server.

Blocked clients

Indicates the number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH).

Number

A low value is desired for this measure.

Biggest input buffer size

Indicates the largest input buffer across all clients.

MB

If the value of this measure is 1GB, you may want to know which client has an input buffer this big. For this purpose, sort the detailed diagnosis of the Total number of connected clients measure in the descending order of the values of the Input buffer size column. Then, you may want to clear this input buffer to reduce its size, as otherwise, that client may be shut down.

Longest output list

Indicates the longest output list across all clients.

Number

If the value of this measure is very high, it indicates that some client has a very long output list. This in turn could indicate that the output buffer is overflowing. You may want to resize the output buffer to avoid this.

To identify the client with the longest output list, sort the detailed diagnosis of the Total number of connected clients measure in the descending order of the values of the Output list column.

The detailed diagnosis of the Total number of connected clients measure provides the details of the clients that are connected to the Redis server.

Figure 1 : The detailed diagnosis of the Total number of connected clients measure