srt_proxy_buffer_size
Sets the size of the proxy buffer for SRT connections in NGINX.
Description
The srt_proxy_buffer_size directive in the NGINX SRT module specifies the buffer size allocated for storing SRT packet data during proxying between SRT and TCP connections. This directive is important for scenarios where the bandwidth or latency varies, allowing the user to optimize the buffering behavior according to the characteristics of the SRT stream being handled. The size is specified in bytes and defines the maximum amount of data that can be buffered before it must be processed or sent to the next connection in the stream.
When configuring this directive, it’s essential to consider the characteristics of the streams being dealt with. For instance, increasing the buffer size can help in high-latency scenarios or with high-bandwidth streams by preventing packet loss due to processing delays or network conditions. However, setting the buffer size too high may lead to excessive memory usage and increased latency in packet processing, while setting it too low may result in packet loss during peak loads.
The directive is utilized within the stream context and needs to be set for every individual SRT server block that needs this specific tuning. This affords fine-grained control over how each SRT connection is managed, allowing users to adapt their configuration to optimal performance for each specific use case.
Config Example
srt {
server {
listen 4321;
srt_proxy_buffer_size 16384;
proxy_pass tcp://127.0.0.1:5678;
}
}Buffer size must be set to a positive integer value.
Exceeding the available memory can lead to instability or failures in NGINX processes.
Changing buffer size may require testing as it affects performance and latency.