nchan_group_max_channels

The `nchan_group_max_channels` directive sets a limit on the maximum number of pub/sub channels allowed within a group in Nchan.

Syntaxnchan_group_max_channels number;
Defaultnone
Contextlocation
Arguments1

Description

The nchan_group_max_channels directive is utilized in the Nchan module to define the maximum number of channels that can exist within a single group. This setting is important for managing resources effectively when dealing with multiple channels, particularly in high-traffic scenarios. By limiting the number of channels, administrators can prevent system overload and ensure stable performance of the pub/sub architecture. The directive must be set within a location block, where it affects only the channels managed under that specific context.

When this directive is specified, it effectively governs the number of active channels in the group defined by the nchan_group directive. If the maximum channel limit is reached, any attempts to create an additional channel may either be denied or result in the deletion of the least recently used channels, depending on the configuration of other related settings. This behavior promotes an efficient use of memory and network resources, as well as an organized handling of channel subscriptions.

It's critical to assess the expected load and the number of concurrent connections when configuring this directive. Proper tuning can significantly enhance the scalability of the Nchan service deployed on Nginx, allowing it to handle varying workloads without degradation in performance due to channel overflow.

Config Example

location /pubsub {
    nchan_pubsub;
    nchan_group_max_channels 100;
}

Ensure that the maximum number configured matches your application's requirements for scalability.

Exceeding this limit may lead to rejected connections or dropped channels, affecting user experience.

This directive should be set where nchan_pubsub or similar configuration is defined; otherwise, it will have no effect.

← Back to all directives