recv_udp_buf

The recv_udp_buf directive sets the size of the UDP receive buffer for SRT connections in NGINX.

Syntaxrecv_udp_buf size;
Default8192
Context
Arguments1

Description

The recv_udp_buf directive configures the buffering size for incoming UDP packets in the context of Secure Reliable Transport (SRT) connections. By specifying the buffer size, users can optimize how much data the NGINX server can handle at once when receiving SRT streams, which is crucial for ensuring smooth performance and minimal latency, especially during high-throughput video transfer scenarios.

This directive is particularly critical in environments where SRT is used for live video delivery or other time-sensitive data transmission. A larger buffer can help absorb spikes in data transmission and prevent packet loss, while a smaller size may reduce memory usage when data flow is predictable. The parameter accepted by this directive is defined in bytes and users should carefully consider the available system memory and expected workloads when configuring this parameter.

As the directive interacts with the underlying network stack, incorrect configuration can lead to performance issues. Thus, thorough monitoring is recommended after applying changes to ensure that the buffer size aligns well with the expected network conditions and traffic patterns. Adjustments may be necessary based on observed performance metrics and error logs after deployment.

Config Example

srt {
    server {
        listen 4321;
        recv_udp_buf 16384;
        proxy_pass tcp://127.0.0.1:5678;
    }
}

Using a buffer size too large may cause excessive memory usage on low-resource servers.

Setting a buffer size too small can lead to packet loss during high traffic conditions.

Ensure the buffer size is compatible with the overall system's network settings.

← Back to all directives