mem_limit
The mem_limit directive sets a memory usage limit for components in the Kaltura Media Framework.
Description
The mem_limit directive is designed to restrict the amount of memory that can be utilized by specific components within the Kaltura Media Framework. This directive can help prevent excessive memory consumption which might lead to performance degradation or even crashes of the media server due to resource exhaustion. When the memory limit specified by this directive is reached by any of the components, it may trigger cleanup tasks or restrict additional memory allocations to maintain stability and performance.
This directive accepts one argument: a signed integer that represents the maximum memory permitted to be consumed by the specified component in bytes or as a suffix with 'k', 'm', or 'g' to denote kilobytes, megabytes, or gigabytes, respectively. For example, a mem_limit set to 512m would limit memory usage of that component to 512 megabytes. The calculation and enforcement of this memory limit are implemented in the backend processing of the Kaltura components, ensuring that efficient memory management occurs during runtime operations.
It is important to define this directive thoughtfully, as setting it too low could lead to service issues where components do not have adequate memory for processing tasks adequately, while setting it too high may allow for unbounded resource consumption, countering the rationale for using it in the first place.
Config Example
mem_limit 512m;
Setting the limit too low may cause components to fail under load.
Be aware that memory limits apply to individual components, not the entire server. Ensure limits are set according to the specific needs of each component.
Testing your application thoroughly is recommended to find the best memory limit settings for your use case.