ts_kmp_max_free_buffers

The `ts_kmp_max_free_buffers` directive controls the maximum number of free buffers available for the Kaltura Media Protocol (KMP) streaming server.

Syntaxts_kmp_max_free_buffers number;
Defaultnone
Contextstream, stream server
Arguments1

Description

The ts_kmp_max_free_buffers directive is an essential configuration option for optimizing buffer management in Kaltura’s Media Framework. This directive specifies the maximum number of free buffers that should be maintained, allowing for efficient resource management when handling streaming media. When configured, it helps mitigate potential memory exhaustion by limiting the number of available buffers to a predefined threshold. This is particularly useful in high-load scenarios where numerous streaming connections may occur, enabling NGINX to efficiently allocate and free buffer resources as needed.

The directive works in contexts such as stream and stream server, which are specifically tailored for handling TCP streams. Setting the value for ts_kmp_max_free_buffers involves providing a positive integer that represents the maximum allowable number of free buffers. If the count of free buffers exceeds this limit during operation, NGINX will begin to reclaim buffers in accordance with its internal memory management routines, ensuring that memory consumption remains within reasonable bounds.

Care should be taken when adjusting this parameter, as allocating too few buffers may lead to performance degradation during peak usage times, while allocating too many may waste memory resources. It's recommended to monitor buffer utilization closely and adjust based on observed performance metrics specific to the server and application workload.

Config Example

stream {
    server {
        ts_kmp_max_free_buffers 100;
    }
}

Setting this value too low may lead to streaming performance issues under high load.

Ensure to test the impact of configuration changes in a staging environment before applying to production.

← Back to all directives