stream_server_traffic_status_zone

The 'stream_server_traffic_status_zone' directive defines shared memory zones for collecting statistics of stream servers' traffic.

Syntaxstream_server_traffic_status_zone name size;
Defaultnone
Contexthttp
Argumentsnone

Description

The 'stream_server_traffic_status_zone' directive is part of the NGINX stream server traffic status module. It enables the creation of shared memory zones that are used to store traffic statistics for stream servers. This information can be utilized for monitoring and performance analytics, providing insights into connection counts, bytes sent and received, among other metrics. The use of shared memory allows for real-time traffic status updates without significant performance overhead. The statistics are accessible through specific request URIs, facilitating integration with external monitoring tools and dashboards.

When you define a traffic status zone, you need to specify its name and size, which determines how much data can be accumulated at any given time. Any connections handled by the downstream servers will have their statistics collected in this defined zone. It's important to note that the namespace used in this directive must be unique to avoid conflicts with other shared memory allocations in NGINX. This enables multiple traffic zones to coexist, each dedicated to different servers or groups of servers, allowing for granular monitoring and management of traffic across various parts of your architecture.

Config Example

stream {
    stream_server_traffic_status_zone my_zone 10m;
}

Ensure zone name is unique to prevent conflicts with other shared memory zones.

Monitor the memory usage, as allocating too large a size may affect performance.

Confirm that the NGINX worker processes have the proper permissions to access the shared memory.

← Back to all directives