nchan_benchmark_messages_per_channel_per_minute

The directive `nchan_benchmark_messages_per_channel_per_minute` sets a benchmark limit on the number of messages that can be published to a specific channel within a minute.

Syntaxnchan_benchmark_messages_per_channel_per_minute number;
Defaultnone
Contextlocation
Arguments1

Description

The nchan_benchmark_messages_per_channel_per_minute directive is used to impose a maximum limit on the number of messages that can be published to a single channel in Nchan within a 60-second window. This is particularly useful for mitigating abuse and reducing the server’s workload, thereby maintaining responsiveness under high traffic conditions.

When the limit set by this directive is reached, any further publish requests to that channel will be rejected until the next minute begins. This helps ensure efficient resource management and can act as a form of rate limiting for message publishing operations. It is particularly crucial in scenarios where a single channel might receive an overwhelming amount of messages, causing performance issues or even service disruptions.

The directive requires one argument, which specifies the maximum number of messages allowed per minute for each channel. Administrators should carefully choose a value that balances performance needs with user experience, particularly in high-throughput environments.

Config Example

location /some_location {
    nchan_benchmark_messages_per_channel_per_minute 100;
}

Setting this value too low may prevent legitimate usage and cause user frustration.

This directive applies per channel; if multiple channels are used, limits need to be defined for each channel as required.

← Back to all directives