All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Limit output buffer size for Pub/Sub clients

Last Updated:Feb 27, 2026

Tair (Redis OSS-compatible) allocates an output buffer in memory for each connected client. For most clients, this buffer stays small because the client sends a request, waits for the response, and then sends the next request. Pub/Sub clients are different: they receive messages in a push-based fashion, so if a subscriber processes messages slower than publishers produce them, the output buffer grows continuously. Large amounts of data returned by commands from clients can also cause buffer growth. Without a size limit, accumulated buffer data can exhaust all available memory and cause a service failure. The client-output-buffer-limit pubsub parameter prevents this by enforcing a maximum buffer size. When the buffer exceeds the configured limit, Tair closes the connection to the affected client.

How the buffer limit works

The client-output-buffer-limit pubsub parameter consists of three values that define two independent thresholds:

ParameterTypeDescriptionDefault
hard limitBytesFixed ceiling. Tair immediately closes the connection when the buffer reaches or exceeds this value.33554432 (32 MB)
soft limitBytesSustained-usage threshold. Works together with soft seconds.8388608 (8 MB)
soft secondsSecondsDuration window for the soft threshold. Tair closes the connection when the buffer stays at or above the soft limit for this many consecutive seconds.60

The hard limit catches sudden spikes. The soft limit catches slow but sustained buffer growth. Both thresholds are evaluated independently -- whichever triggers first closes the connection.

Important

Pub/Sub uses at-most-once delivery semantics. When Tair closes a connection because the buffer limit is exceeded, all pending messages for that subscriber are lost. For workloads that require stronger delivery guarantees, consider using Redis Streams.

Prerequisites

Before you begin, make sure that you have:

  • A Tair (Redis OSS-compatible) instance

  • Access to the Tair console

Set the buffer limit

  1. Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, click Parameter Settings.

  3. In the parameter list, find the client-output-buffer-limit pubsub parameter and click Modify in the Actions column.

  4. In the dialog box, enter three space-separated values in this order: hard limit, soft limit, and soft seconds. For example, to set a 64 MB hard limit, a 16 MB soft limit, and a 120-second soft window:

       67108864 16777216 120
  5. Click OK.

Verify the configuration

After you save the parameter, verify the values through either method:

  • Console: Return to the Parameter Settings page to confirm the updated values.

  • redis-cli: Connect to the instance with redis-cli and run: The output lists the buffer limits for all client classes (normal, replica, and pubsub).

      CONFIG GET client-output-buffer-limit

Tuning guidelines

  • Choosing values: Set the hard limit high enough to accommodate normal traffic bursts, but low enough to prevent a single slow subscriber from consuming excessive memory. A common starting point is the default (32 MB hard / 8 MB soft / 60 seconds).

  • Monitoring: Watch for frequent client disconnections in your application logs. Frequent disconnections may indicate that the limits are too aggressive or that subscribers need optimization.

  • Scope: This parameter applies only to Pub/Sub clients. Normal clients and replica clients have separate buffer limit settings.

Related API operations

API operation

Description

DescribeParameters

Queries the configuration and operational parameters of an instance.

ModifyInstanceConfig

Modifies the parameter settings of an instance.