send_buf

The `send_buf` directive in the NGINX SRT module specifies the send buffer size in bytes for SRT connections.

Syntaxsend_buf size;
Default8192
Context
Arguments1

Description

The send_buf directive configures the size of the buffer used for sending data over SRT (Secure Reliable Transport) connections in the context of NGINX's SRT module. This buffer size plays a crucial role in determining the efficiency of data transmission, as it can affect how much data can be queued for sending before it is transmitted across the network. A larger buffer can help improve throughput for high-speed connections but may introduce latency in low-speed or high-latency scenarios. Conversely, a smaller send buffer can be beneficial in situations where timely delivery is more critical than maximizing throughput.

In practice, the specified size for send_buf will typically be in bytes and should cater to the expected volume of data being sent and the characteristics of the underlying network. If the buffer is set too low, it may lead to dropped packets if the application is sending data faster than it can be acknowledged by the SRT protocol. If the buffer is set too high, it might result in excessive delay of data, as the protocol might keep data queued for an optimal amount of time before sending. SRT relies on acknowledging sent packets, and thus tuning the buffer size can directly impact the performance and responsiveness of the application utilizing SRT.

This directive can be essential in environments where multiple streams are being handled simultaneously or where the data flow characteristics vary significantly. Monitoring network performance and adjusting the send_buf setting appropriately can result in significant improvements in the handling of streaming media or real-time data transfers.

Config Example

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

Setting the send buffer too small may lead to packet loss in high-throughput scenarios.

A very large send buffer could introduce latency, as data may be queued longer before transmission.

Changes to send_buf may require monitoring and adjustment based on real-world data transmission characteristics.

← Back to all directives