Welcome! Log In Create A New Profile

Advanced

Re: Adjusting server_names_hash_bucket_size before nginx throws an error

Maxim Dounin
January 12, 2017 10:40AM
Hello!

On Thu, Jan 12, 2017 at 03:12:30PM +0300, Vladimir Kozyrev wrote:

> My issue is that I add server {} and upstream {} directives dynamically to
> /etc/nginx/conf.d/dynamic_vhost.conf.
> Once the file grew, nginx stopped working and I increased hash_bucket_size
> parameter to make it work again.
> Is there a way to calculate what value should I set to hash_bucket_size
> parameter for a given number of server {} and upstream {} directives? At
> some point, the file will grow big enough to stop nginx from working once
> again.
> Any advice on how can I prevent that from happening will be appreciated.

The value of server_names_hash_bucket_size limits the maximum
length of a server_name used. If you use long server names, set
it to the maximum name length expected (plus some additional space
for two pointers).

Everything else is not fatal when constructing hashes since nginx
1.5.13. If nginx fails to build an optimal hash with bucket_size
and max_size configured, it simply ignores bucket_size and logs an
appropriate warning (non-fatal).

Some additional information about configuring hashes can be found
at http://nginx.org/en/docs/hash.html.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Adjusting server_names_hash_bucket_size before nginx throws an error

Vladimir Kozyrev January 12, 2017 07:14AM

Re: Adjusting server_names_hash_bucket_size before nginx throws an error

Maxim Dounin January 12, 2017 10:40AM

Re: Adjusting server_names_hash_bucket_size before nginx throws an error

Vladimir Kozyrev January 12, 2017 03:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready