kmp_cc_max_pending_packets
The `kmp_cc_max_pending_packets` directive controls the maximum number of packets that can be queued for transmission in the Kaltura Media Framework's Common NGINX module.
Description
The kmp_cc_max_pending_packets directive primarily affects how the Kaltura Media Framework (KMF) manages data transmission through buffering. When media packets are streamed, they need to be queued before they are transmitted to clients. This directive sets a limit on how many packets can be held in this queue at any given time, which helps manage memory usage and ensures that the system can react timely to real-time streaming demands.
The argument for this directive is an integer value that signifies the maximum number of packets that can be held. Exceeding this limit may result in packet drops, which can affect streaming performance and lead to interruptions in media delivery. Careful tuning is necessary based on the expected load and network conditions. It's important to monitor other performance metrics, as setting this value too low could hinder throughput, while setting it too high may cause excessive memory consumption and resource contention.
This directive is applicable within the stream and stream server contexts, which means it is relevant for handling streamed data rather than HTTP requests. It's critical for live or on-demand video streaming scenarios, where maintaining a balance between latency and resource usage is essential for optimal user experience.
Config Example
stream {
server {
kmp_cc_max_pending_packets 64;
}
}Not caring for system memory limits can lead to packet loss if the limit is set too high.
Setting the limit too low might increase latency or lower throughput, affecting the streaming performance.
Make sure to configure this directive in the right context; it is only applicable in stream-related directives.