server_traffic_status_limit_traffic

Limits the amount of traffic statistics collected in the NGINX stream server module.

Syntaxserver_traffic_status_limit_traffic number | size;
Defaultnone
Contextstream, stream server
Arguments1-2

Description

The server_traffic_status_limit_traffic directive is part of the NGINX stream server traffic status core module. It is designed to control how much traffic data is retained for each stream server in the event that traffic grows significantly. By setting appropriate limits using this directive, administrators can ensure that the performance of their NGINX instance is not degraded due to excessive resource consumption caused by high traffic volumes. The directive allows two optional arguments: the first specifies the maximum number of statistics entries to retain, while the second defines the maximum amount of memory to allocate for these statistics. If the defined limits are reached, older entries may be discarded to make way for new ones, ensuring that memory usage remains manageable while still providing useful traffic data.

Config Example

stream {
    server {
        listen 1234;
        server_traffic_status_limit_traffic 1000 10m;
    }
}

Setting a limit that is too low may result in the loss of important traffic data during peak times.

There is no default value, so this directive must be explicitly set for it to take effect.

← Back to all directives