nchan_redis_cluster_recovery_delay_max

Limits the maximum delay for recovery after a Redis cluster failure in the Nchan module.

Syntaxnchan_redis_cluster_recovery_delay_max milliseconds;
Defaultnone
Contextupstream
Arguments1

Description

The nchan_redis_cluster_recovery_delay_max directive is used within the Nginx Nchan module to determine the maximum allowable delay for recovering from a failure in a Redis cluster setup. This setting is particularly useful in scenarios where Nchan is used as a pub/sub server that relies on Redis for message buffering and delivery. By configuring this directive, administrators can control how long Nchan will wait to reconnect to the Redis cluster before it stops trying, thereby enabling more predictable recovery behavior for applications relying on this service.

When the directive is set, the value defines the maximum delay in milliseconds that Nchan will wait after a cluster failure before it attempts to re-establish connections. A short delay might speed up recovery but could lead to frequent connection attempts that may overwhelm the Redis servers. Conversely, a longer delay may slow down recovery but reduce the load on servers. Adjusting this value allows for finer control over how Nchan interacts with Redis in a fault-tolerant manner, thereby enhancing the reliability of the pub/sub system within high-availability architectures.

The value must be specified in a numeric format, directly following the directive in the configuration file. This allows for flexible configurations tailored to specific deployment needs, accommodating varying network conditions and server loads. It is important to consider the overall architecture and failure handling strategy when setting this value to ensure optimal performance and resilience in the system.

Config Example

upstream my_redis_cluster {
    server 192.168.1.1:6379;
    server 192.168.1.2:6379;
    nchan_redis_cluster_recovery_delay_max 5000;
}

Setting too low a delay may lead to excessive reconnection attempts under heavy load or frequent failures.

If the Redis cluster is persistently unavailable, the configured maximum delay will still result in Nchan failing after the defined duration, potentially causing downtime.

Ensure that the specified milliseconds value is appropriate for your application's tolerance to delays. Overestimation can lead to slow recovery times.

← Back to all directives