nchan_redis_cluster_recovery_delay

Sets a delay for recovery of Nchan subscribers in a Redis cluster when a connection drops.

Syntaxnchan_redis_cluster_recovery_delay time;
Defaultnone
Contextupstream
Arguments1

Description

The nchan_redis_cluster_recovery_delay directive specifies a time delay before a subscriber connection attempts to recover its subscription after a connection drop in a Redis cluster setup. This delay can help manage subscriber reconnections in high-load or unstable network conditions, providing a buffer period during which it can be determined if a temporary network glitch has occurred or if the Redis node is down.

The directive takes one argument that specifies the recovery delay in seconds. It should be carefully configured to suit the operational environment's network stability and performance requirements. Setting this value too low might lead to excessive churn in connection attempts and increased server load, while a value that is too high may result in delayed message delivery to subscribers.

This directive is particularly useful in scenarios where maintaining a resilient pub/sub system is critical, and ensures that subscribers do not flood the server with reconnection requests if a brief outage occurs. It acts as a form of congestion control, balancing responsiveness with system stability.

Config Example

upstream nchan {
    nchan_redis_cluster_recovery_delay 5;
    server redis1:6379;
    server redis2:6379;
}

Ensure that the recovery delay does not conflict with your application's latency requirements.

Be careful not to set a recovery delay that is too low or too high, which could either overwhelm the server with connection attempts or introduce unacceptable latency.

This directive is only relevant when using Redis cluster setups; in other configurations, it has no effect.

← Back to all directives