push_stream_ping_message_interval
Sets the interval at which ping messages are sent to maintain open WebSocket connections.
Description
The push_stream_ping_message_interval directive specifies the time interval for sending ping messages to subscribers in WebSocket connections, ensuring that the connection remains active. This is particularly important for keeping the connection alive during periods of inactivity and for detecting broken connections. By default, this value is unset, meaning ping messages will not be sent unless explicitly defined.
When configuring this directive, it helps to consider the network conditions and the expected activity levels on the channels. Shorter intervals may ensure faster detection of broken connections but could create additional network overhead. On the other hand, longer intervals reduce the frequency of ping messages but might lead to situations where unresponsive clients remain connected for longer periods. Finding a balance that suits the specific use case and load on the system is crucial during configuration to maintain both performance and reliability.
Config Example
http {
push_stream_ping_message_interval 1m;
}This directive must be set to a valid time interval; invalid values will cause configuration errors.
Be cautious with setting too short of an interval, as this could lead to excessive network traffic, especially with numerous clients.