Welcome! Log In Create A New Profile

Advanced

Re: server_names scaling

Maxim Dounin
April 16, 2014 07:00AM
Hello!

On Wed, Apr 16, 2014 at 08:38:10PM +1000, SplitIce wrote:

> Hi all,
>
> I have spent the day troubleshooting why one server in our network reloaded
> / tested configuration extremely slowly.
>
> We have found that server_names scales very poorly, once a certain point is
> reached (approx 5.5k entries globally, 5k entries for a single host)
> performance drops from a <0.5s reload time to 15s+.
>
> The large host of ~5,000 entries is a malware domain zone and all server
> names in this zone are using the wildcard name format.
>
> For now we have resolved this issue by fixing an inefficiency in our
> configuration (namely using *.domain.com and domain.com) however I feel
> this is most likely a bug or at-least an unintended behaviour.
>
> Relevant configuration entries:
> server_names_hash_max_size 8000;
> server_names_hash_bucket_size 128;

With max_size 8000, and 5k entries - probability of collisions
while building a cache is high (think of birthday paradox). And
bucket_size 128 isn't high enough to allow multiple collisions.
As a result, nginx may (and likely will) spend a lot of time trying
to build an optimal hash.

Trivial solution is to use higher max_size and/or bucket_size.

--
Maxim Dounin
http://nginx.org/

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

server_names scaling

splitice April 16, 2014 06:40AM

Re: server_names scaling

Maxim Dounin April 16, 2014 07:00AM

Re: server_names scaling

splitice April 16, 2014 07:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
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