netcall_timeout
The netcall_timeout directive sets the maximum time to wait for a network call in the NGINX RTMP module.
Description
The netcall_timeout directive is used in the context of the NGINX RTMP module to specify the timeout period for network calls involving streaming operations. When a stream is being processed, it may require establishing connections to clients or media sources, which involves sending data over the network. If these operations take longer than the specified timeout value, NGINX will terminate the operation to prevent hanging or indefinite waiting periods.
This directive accepts a single argument, which is the timeout duration in milliseconds. It allows administrators to enforce stricter constraints on network responsiveness, ensuring that if a media request or a push from a RTMP client does not respond within the allotted timeframe, the server will drop that connection. This is particularly important in real-time streaming environments where latency can significantly affect the user experience and overall system performance.
Correctly configuring the netcall_timeout directive can help improve the reliability and availability of the services provided by NGINX, especially during times of high network load or when dealing with unreliable network conditions. It’s crucial to find a balance between setting a timeout that is too short, which may lead to false drops of legitimate connections, and a timeout that is too long, which may result in delays and dissatisfied users.
Config Example
rtmp {
server {
listen 1935;
application myapp {
live on;
netcall_timeout 3000;
}
}
}Setting the timeout too low may inadvertently drop legitimate connections during brief network disturbances.
Ensure that the specified timeout is appropriate for your use case, especially in environments with known latency, such as remote connections.