map_hash_bucket_size

The `map_hash_bucket_size` directive sets the bucket size for hash tables in the NGINX SRT module, optimizing memory usage and performance.

Syntaxmap_hash_bucket_size size;
Defaultnone
Context
Arguments1

Description

The map_hash_bucket_size directive is designed to control the bucket size of hash tables specifically for the Secure Reliable Transfer (SRT) feature in NGINX. By adjusting the bucket size, administrators can influence the memory allocation and enhance the performance of applications that involve dynamic variable mappings within SRT connections. This can lead to more efficient handling of variable data due to better distribution across the hash table buckets.

When the bucket size is increased, it may lead to fewer collisions within the hash table, which can be beneficial for applications with extensive variable usage. However, increasing the bucket size could also increase overall memory consumption. Conversely, a smaller bucket size saves memory but can result in a higher number of collisions, ultimately impacting performance negatively. Therefore, selecting an appropriate bucket size is crucial depending on the anticipated load and the nature of variable usage in the application.

The directive accepts only a single numeric argument that defines the size in bytes. Adequately configuring this directive can enhance the efficiency of SRT operations but requires careful consideration of the server's available resources versus the expected workload.

Config Example

map_hash_bucket_size 128;

Setting the bucket size too small may lead to a higher collision rate, degrading performance.

A very large bucket size could unnecessarily increase memory usage without providing significant performance benefits.

← Back to all directives