Server_names_hash_bucket_size of nginx

Source: Internet
Author: User

In nginx 0.6.35, to configure multiple server virtual hosts, you must add server_names_hash_bucket_size 64 in HTTP {.

HTTP {

Server_names_hash_bucket_size 64;

Include mime. types;
Default_type application/octet-stream;
............. Omitted

}

Otherwise, not only does nginx fail to be started, but the nginx-T will prompt you when testing the configuration document.

Cocould not build the server_names_hash, you shocould increase server_names_hash_bucket_size: 32
2009/02/20 13:54:27 [emerg] 11372 #0: the configuration file/opt/nginx/CONF/nginx. conf test failed

The following is an excerpt from the Chinese wiki.
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.

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.