mss
The 'mss' directive sets the maximum segment size for SRT connections in NGINX.
Description
The mss directive in the NGINX SRT module defines the maximum segment size (MSS) that can be used for SRT (Secure Reliable Transport) connections. By specifying this value, you can control the size of the data packets that NGINX is allowed to send over SRT connections, which can optimize performance and ensure compatibility with the network conditions and the receiving application's capabilities.
The mss value is specified in bytes and is usually set to a value that reflects the maximum transmission unit (MTU) of the underlying network minus the overhead introduced by headers. The default value for mss is 1500, which corresponds to a common Ethernet MTU. If you have specific networking needs or are working in constrained environments, adjusting this value can help in avoiding fragmentation or ensuring that your data is transmitted efficiently.
This directive can be configured at both the srt and server contexts, allowing fine-grained control over different SRT servers or configurations that may have varying requirements. When tuning the MSS, it's crucial to test the configuration under different network conditions to find the most suitable setting that balances performance and reliability.
Config Example
srt {
server {
listen 4321;
mss 1400;
proxy_pass tcp://127.0.0.1:5678;
}
}Setting the MSS too low can lead to inefficient use of bandwidth as it may increase the overhead of packet headers.
Conversely, a value too high may result in packet fragmentation on networks with smaller MTUs, which can degrade performance.