nchan_redis_cluster_recovery_delay_jitter

Controls the jitter delay during Redis cluster recovery for Nchan pub/sub scenario.

Syntaxnchan_redis_cluster_recovery_delay_jitter milliseconds;
Defaultnone
Contextupstream
Arguments1

Description

The nchan_redis_cluster_recovery_delay_jitter directive allows you to introduce a random jitter in the delay period when recovering connections to a Redis cluster. This helps to distribute the load more evenly across the Redis nodes and can prevent overloading, which is especially useful when multiple clients attempt to reconnect at the same time. The directive takes one argument, which specifies the maximum amount of jitter (in milliseconds) to be added to the recovery delay. This randomness can improve overall system stability and performance during recovery phases by reducing the likelihood of creating a spike in load that can cause further failures.

When configuring this directive, it is important to recognize that the recovery delay itself is influenced by other factors such as the overall health of the Redis cluster and the specific recovery logic of Nchan. The directive should be set to an appropriate value based on the anticipated load and the resiliency of your Redis setup. Setting it to a very high value might delay recovery times unnecessarily, while a very low value may negate the benefits of added randomness. Thus, careful tuning of this parameter is recommended to find a suitable balance for your specific use case.

Config Example

upstream redis_cluster {
    server redis-node1:6379;
    server redis-node2:6379;
    nchan_redis_cluster_recovery_delay_jitter 100;  
}

Ensure the jitter value is not set too high to avoid unnecessarily long recovery times.

Test under load to determine the best jitter value for production deployments.

← Back to all directives