4 messages in ru.sysoev.nginxRe: Meaning of server_names_hash_buck...
FromSent OnAttachments
Liang JinMay 14, 2007 12:31 am 
Igor SysoevMay 14, 2007 5:08 pm 
Liang JinMay 14, 2007 10:09 pm 
Igor SysoevMay 16, 2007 1:57 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Meaning of server_names_hash_bucket_sizeActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:May 16, 2007 1:57:36 pm
List:ru.sysoev.nginx

On Mon, May 14, 2007 at 10:09:56PM -0700, Liang Jin wrote:

So, my understanding now is that _hash_max_size will control the number of virtual host entries, while _hash_bucket_size will control the maximum length of single entries, right?

Yes. Also there may be several entries inside one bucket if they fill.

If I have a lot of virtual host entries, i should increase _hash_max_size, while I should increase _hash_bucket_size if some domain names are too long.

Yes.

Anyway, thanks again for the answer.

On 5/14/07, Igor Sysoev <is-G@public.gmane.org> wrote:

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).