variables_hash_bucket_size

Sets the bucket size for the variables hash table in the SRT module.

Syntaxvariables_hash_bucket_size size;
Default64
Context
Arguments1

Description

The variables_hash_bucket_size directive configures the size of each bucket in the hash table used to store variables in the SRT (Secure Reliable Transfer) context. This is important for managing how variable names are organized and accessed efficiently. The specified bucket size can impact performance and memory usage, particularly when many SRT streams or connections are being handled simultaneously.

By default, the bucket size is set to 64 bytes, which is a typical value suitable for most scenarios. Adjusting this size may be beneficial in cases of high-performance applications or when dealing with a large number of variables. If the bucket size is too small, it may lead to increased collisions and reduced access speed. Conversely, a very large bucket size could waste memory resources. It is advisable to tune this parameter based on the specific workload and resource constraints of the server. The value should be a power of 2 for optimal performance.

It is important to note that any changes to this directive will require a reload of the NGINX configuration for them to take effect, thus careful consideration and testing is recommended before implementing any changes in a production environment.

Config Example

srt {
    variables_hash_bucket_size 128;
}

Setting this value too low may lead to hash collisions, affecting performance.

Using a non-power of two value may not yield optimal results.

← Back to all directives