Nginx could not build the Server_names_hash workaround _nginx

Source: Internet
Author: User
Tags hash
Nginx "Nginx could not build the Server_names_hash" workaround

Added a few site aliases to a server, almost 20 more.

When restarting Nginx, prompt:

Could not builds the Server_names_hash, you should increase server_names_hash_bucket_size:32

Workaround:

Add one line of configuration to the http{} segment of the configuration file
Server_names_hash_bucket_size 64;
If 64 is not enough, then add up by a multiple of 32.

Here is a description of the excerpt on the Chinese wiki:

The hash table that holds the server name is controlled by instruction 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 processor cache size. After reducing the number of accesses in memory, it is possible to accelerate the lookup of hash key values in the processor. If the hash bucket is equal to the size of the processor cache at the same time, the number of times to find the key in memory is 2. The first time is to determine the address of the storage unit, and the second is to locate the key value in the storage cell. Therefore, if nginx gives hints that need to increase the size of the hash max size or hash bucket, it is important to increase the previous parameter.
Related Article

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.