kmp_rtmp_in_read_timeout

The `kmp_rtmp_in_read_timeout` directive specifies the timeout duration for reading RTMP input streams.

Syntaxkmp_rtmp_in_read_timeout time;
Defaultnone
Contextstream, stream server
Arguments1

Description

The kmp_rtmp_in_read_timeout directive is part of the Kaltura Media Framework's NGINX module, specifically used in the context of stream and stream server blocks. Its primary function is to set the maximum time duration NGINX will wait while attempting to read RTMP input streams before timing out the connection. This is particularly important in live streaming scenarios, where input streams may intermittently drop or experience buffering issues. By configuring this timeout, administrators can manage how long they tolerate delays before a stream is considered inactive, ultimately helping to control resources and maintain service responsiveness.

The directive accepts a single argument that specifies the timeout duration. This argument can be expressed in seconds, milliseconds, or other time formats supported by NGINX, allowing for flexible configurations based on the streaming environment. If the configured timeout elapses without receiving data, NGINX will terminate the connection, which can help prevent lingering inactive streams from consuming system resources. It’s beneficial to adjust this setting based on the expected reliability of the incoming feed and the network conditions.

When implementing the kmp_rtmp_in_read_timeout, it should be noted that setting this value too low may result in premature timeouts, particularly in less stable network environments. Conversely, setting it too high could lead to an unresponsive system if input streams become inactive for extended periods. Therefore, careful consideration should be given to this value based on real-world testing and the performance characteristics of the media being streamed.

Config Example

stream {
    server {
        listen 1935;

        kmp_rtmp_in_read_timeout 30s;
    }
}

Make sure the specified timeout is appropriate for your network's stability to avoid unnecessary connection terminations.

Adjusting the timeout may require additional testing to find optimal values based on varying stream characteristics.

← Back to all directives