nchan_redis_idle_channel_keepalive_backoff

The `nchan_redis_idle_channel_keepalive_backoff` directive controls the backoff strategy for keeping alive idle Redis pub/sub channels.

Syntaxnchan_redis_idle_channel_keepalive_backoff time;
Defaultnone
Contextupstream
Arguments1

Description

In the Nchan module's configuration, the nchan_redis_idle_channel_keepalive_backoff directive is used to specify the time duration for retries during the keepalive process of an idle channel within Redis. When a channel is not actively being subscribed to or published on, it can be beneficial to maintain a connection to Redis for efficiency; however, continuous active connections for idle channels may lead to resource wastage.

This directive sets a backoff strategy when a channel is idle, meaning that if the keepalive checks fail, the duration between each successive retry increases according to the specified backoff value. This adaptive approach minimizes load on the Redis server while still attempting to maintain a persistent connection when necessary. A correct configuration can enhance the performance and scalability of applications that rely on Redis for message passing, especially in highly concurrent environments.

By adjusting this directive, administrators can tune the behavior to best fit their workload, optimizing the interaction between Nginx, the Nchan module, and Redis. Choosing an appropriate value takes into account the specific use case and may require testing to find the optimal setting.

Config Example

upstream my_redis {
    server 127.0.0.1:6379;
    nchan_redis_idle_channel_keepalive_backoff 30s;
}

Ensure that the configured backoff time does not exceed your application's tolerance for latency in message delivery.

Values that are too low may lead to excessive connection checks on Redis, impacting performance.

← Back to all directives