stream_server_traffic_status_average_method
The `stream_server_traffic_status_average_method` directive modifies how average traffic statistics are calculated in the NGINX streaming status module.
Description
The stream_server_traffic_status_average_method directive provides control over the method used to compute average metrics related to traffic data in the NGINX stream server traffic status module. Primarily, this directive allows administrators to choose between different calculation approaches, permitting flexibility in how averages are presented based on traffic loads and time intervals. It accepts one or two parameters: the first specifies the statistical method to use, and the optional second parameter can help fine-tune the behavior of the chosen method, potentially through the designation of a coefficient or factor influencing the calculation.
This directive comes in handy during performance analysis or when generating reports on traffic loads, helping users derive insights based on either a smooth moving average or more rapid responsive metrics that highlight current conditions. Because the traffic status module aggregates data across multiple requests, the choice of average calculation method can significantly impact visibility into traffic patterns over various time frames, enabling users to efficiently monitor and optimize performance in real-time.
Config Example
stream {
server {
listen 1234;
}
stream_server_traffic_status average_method simple;
}Make sure the method specified is supported; otherwise, it will default to 'none'.
Beware of performance implications; choosing a complex calculation method may tax your NGINX instance under high loads.