Meaning of server_names_hash_bucket_size

Igor Sysoev is at
Tue May 15 04:08:58 MSD 2007

On Mon, May 14, 2007 at 12:31:51AM -0700, Liang Jin wrote:

> I have seen the following error in nginx log on my server:
> could not build the server_names_hash, you should increase
> server_names_hash_bucket_size: 32
> The problem was solved after I changed the setting to 128.
> However, I am curious to know what the setting will actually do. If I
> have many virtual hosts, I will need a larger number for the bucket
> size, but how can I determine what would be a good number to set this
> parameter?

The hashes have two parameters: ..._hash_bucket_size and ..._hash_max_size.
First you should increase hash_max_size. But if single entry can not fill
inside bucket, then nginx says that you should increase ..._hash_bucket_size.
In this case try 64 and 96 before 128. the single entry may not fill inside
server name bucket if you have at least one long server name (in your case
there is name more than 27 characters).

Igor Sysoev

More information about the nginx mailing list