Server_names_hash for Nginx domain name configuration

Source: Internet
Author: User
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 !"
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.