map_hash_max_size

Sets the maximum size of the hash table used for SRT variables in the NGINX SRT module.

Syntaxmap_hash_max_size size;
Default1024
Context
Arguments1

Description

The map_hash_max_size directive specifies the maximum size for the hash table that stores variables for the Secure Reliable Transfer (SRT) handling in the NGINX SRT module. This parameter is critical as it defines the upper limit of entries in the hash table, which directly impacts how many variables can be efficiently handled and stored during SRT connection processing.

When a hash table is created, its size must be predefined, and if the actual demand exceeds the specified maximum size, the NGINX server may face limitations or performance degradation while trying to accommodate additional variables or sessions. Therefore, appropriate tuning of this directive is essential for optimal server performance, especially under heavy loads or numerous variable usage scenarios.

This directive is typically used in conjunction with the variables_hash_bucket_size directive, which specifies the size of each bucket within the hash table. Together, these directives ensure that hash table dimensions are adequately calibrated for the expected workload, allowing for efficient variable management and retrieval, resulting in improved response times and reduced latency in SRT connections.

Config Example

srt {
    variables_hash_max_size 2048;
}

Setting the value too low can lead to dropped connections or failure to manage SRT variables effectively.

Excessively high values may consume unnecessary memory, impacting overall performance. Use it judiciously based on expected load.

← Back to all directives