pull_reconnect
The pull_reconnect directive specifies whether to enable connection retries when pulling streams in the NGINX RTMP module.
Description
The pull_reconnect directive is utilized in the context of the NGINX RTMP module to facilitate the process of pulling streams from remote sources. When a stream is initiated, the directive controls the mechanism of retrying the connection to the source when the initial connection attempt fails. This capability is particularly useful in scenarios where the source stream might be temporarily unavailable due to network fluctuations or server downtime.
The directive accepts a single argument that specifies the retry interval in milliseconds. Setting a value here allows the NGINX server to attempt reconnections at the specified intervals until it either successfully establishes a connection or exhausts predefined retry attempts. This feature enhances the resilience of streaming services by ensuring that brief outages do not lead to significant downtimes or interruptions in service.
It is important to note that misconfiguration of the pull_reconnect directive can lead to excessive reconnection attempts, which could increase load on both the NGINX server and the source server, potentially leading to throttling or blocking from the source due to excessive requests. Therefore, it must be configured with consideration of network reliability and behavior of the target streaming source.
Config Example
application myapp {
live on;
pull_reconnect 5000;
}Setting pull_reconnect to a very low value may overwhelm the source server with connection attempts.
Ensure the pull source is correctly configured to accept multiple connections if using reconnects frequently.
Check your network stability to avoid unnecessary reconnection attempts.