When configuring the Nginx server today, the configuration file check reported: couldnotbuildtheserver_names_hash, youshouldincreaseserver_names_hash_bucket_size: 32 checked a WIKI and saw the following content: the hash table storing the server name is...
When configuring the Nginx server today, the configuration file check reports:
Cocould not build the server_names_hash, you shocould increase server_names_hash_bucket_size: 32
Check a WIKI and see the following content:
The hash table that saves the server name is controlled by the command server_names_hash_max_size and server_names_hash_bucket_size.
The parameter hash bucket size is always equal to the size of the hash table, and is a multiple of the cache size of a single processor. After reducing the number of accesses in the memory, it is possible to accelerate the search for hash table key values in the processor.
If the size of the hash bucket is equal to the cache size of one processor, the number of times the hash bucket is searched in the memory is 2 in the worst case when the search key is used. The first is to determine the address of the storage unit, and the second is to find the key value in the storage unit. Therefore, if Nginx prompts you to increase the hash max size or hash bucket size, increase the size of the previous parameter first.
Solution:
Modify the nginx. conf file and add a configuration line in the http {} segment:
Server_names_hash_bucket_size 64;
If 64 is not enough, add a multiple of 32.
Author: "Xiao Qiang's blog !"