Tair (Redis OSS-compatible) provides the client-output-buffer-limit pubsub parameter for you to specify a size limit for output buffers of Pub/Sub clients. If the data to be buffered for a Pub/Sub client exceeds the size limit, Tair (Redis OSS-compatible) closes the connection to the client. This prevents the buffered data from consuming excessive amounts of memory and ensures the performance of Tair (Redis OSS-compatible).
Limits on output buffers
Tair (Redis OSS-compatible) allocates an output buffer in the memory to each client. After Tair (Redis OSS-compatible) processes the requests from clients, it temporarily stores response data in output buffers and then sends the data to the clients. If you do not limit the data size in output buffers, large amounts of data may accumulate in output buffers. The data may eventually use up all the available memory and result in a service failure. This issue may occur in the following scenarios:
Large amounts of data need to be returned for commands from clients.
Message publishing outpaces message consumption.
You can set the client-output-buffer-limit pubsub parameter to a proper value to prevent the output buffers of Pub/Sub clients from consuming excessive amounts of memory.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
In the left-side navigation pane, click Parameter Settings.
In the parameter list, find the client-output-buffer-limit pubsub parameter and click Modify in the Actions column.
In the dialog box that appears, set the
hard limit,soft limit, andsoft secondsvalues in sequence and separate them with spaces.Parameter options:
hard limitspecifies a fixed limit in bytes. If the memory size used by the output buffer of a Pub/Sub client reaches or exceeds thehard limitvalue, Tair closes the connection to the client.soft limitandsoft secondswork together to define a soft boundary condition. If the output buffer of a Pub/Sub client reaches or exceeds thesoft limitvalue (in bytes) for thesoft secondsduration (in seconds), Tair closes the connection to the client.
NoteThe default value of the
hard limitoption is 33554432 bytes (or 32 MB), the default value of thesoft limitoption is 8388608 bytes (or 8 MB), and the default value of thesoft secondsoption is 60 seconds.
Click OK.
After you set the options, you can view the settings in the console. You can also use redis-cli to connect to the instance and run the CONFIG GET client-output-buffer-limit command to view the settings.
Related API operations
API operation | Description |
Queries the configuration and operational parameters of an instance. | |
Modifies the parameter settings of an instance. |