proxy_tcp_nodelay

The `proxy_tcp_nodelay` directive enables or disables the TCP_NODELAY option for proxies in the NGINX SRT module, controlling packet delay.

Syntaxproxy_tcp_nodelay on | off;
Defaultoff
Context
Argumentsflag

Description

The proxy_tcp_nodelay directive allows you to set the TCP_NODELAY option for TCP connections established by NGINX proxy servers utilizing the SRT module. When this option is enabled, it disables Nagle's algorithm, which groups small packets to send them all at once to improve network efficiency. Disabling Nagle's algorithm can enhance performance in scenarios where low latency communication is more critical than bandwidth efficiency, such as in real-time audio or video streaming applications. This can lead to faster transmission of packets once they are ready to be sent without waiting for the accumulation of additional data to form larger packets.

When you set proxy_tcp_nodelay to on, it configures the TCP stack to send packets immediately even if the segment size is below the Maximum Segment Size (MSS). Conversely, setting it to off will allow the default system behavior, which may include delays for packet aggregation. As a result, the choice of enabling or disabling this option can significantly affect latency and overall system performance, especially in real-time data transfer scenarios. It is important to carefully assess your application's network performance requirements before making the decision to enable this directive.

Config Example

srt {
    server {
        listen 4321;
        proxy_tcp_nodelay on;
        proxy_pass tcp://127.0.0.1:5678;
    }
}

Ensure that enabling this option does not negatively impact overall network throughput for your application.

Be mindful of the specific use-case for low-latency communication versus high-throughput requirements when configuring this directive.

← Back to all directives