nchan_redis_cluster_recovery_delay_backoff

Sets the backoff delay for Redis cluster recovery attempts when a node becomes unreachable.

Syntaxnchan_redis_cluster_recovery_delay_backoff seconds;
Defaultnone
Contextupstream
Arguments1

Description

The nchan_redis_cluster_recovery_delay_backoff directive is part of the Nchan module and is specifically used to dictate the delay in recovering from a Redis cluster node failure. When a Redis cluster node becomes unavailable, Nchan will use a backoff strategy to manage reconnection attempts. This delay is crucial to prevent excessive connection attempts to a failing node, which can lead to further issues such as network congestion or resource exhaustion. By controlling the backoff time, administrators can fine-tune the recovery process, balancing between timely reconnections and overloading the network with failed connection attempts.

This directive takes a single argument, which specifies the delay in seconds. When the node recovery is attempted, it will wait for this specified duration before making another attempt to connect to the node. If this time interval is too low, it could lead to a loop of connection attempts if the node remains down, while too high a value might delay the restoration of service. Therefore, it is recommended to configure this parameter based on the expected downtime of the Redis nodes and the overall requirements of the application using Nchan.

The directive can be included in the upstream block of the Nginx configuration, where the Redis cluster's settings are typically defined. This allows for seamless integration with existing Redis configurations, providing a way to specify recovery behavior directly within the cluster configuration context.

Config Example

upstream redis_cluster {
    server redis-node1:6379;
    server redis-node2:6379;
    nchan_redis_cluster_recovery_delay_backoff 10;
}

Setting this value too low may result in rapid reconnection attempts, causing undue load on both the Nginx server and the Redis nodes.

If set too high, it might significantly delay recovery after a Redis cluster failure, impacting overall system responsiveness.

← Back to all directives