Use primes for hashtable size

Andrew Borodin borodin at
Sun Jun 4 18:22:43 UTC 2017

2017-06-04 8:35 GMT+05:00 Mathew Heard <mat999 at>:
> Sorry as the slow starts only occur on the production servers, and I don't
> have the time currently to try and replicate elsewhere I can't profile it.
> I know a portion is from the hashtable size as we have gradually increased
> it over the years with a positive effect on startup time. Last we tested
> setting the bucket size to 128 yields a startup time decrease, but a slight
> runtime performance decrease.

OK. This seems reasonable.
Are your hash sizes more than 10000?

In it's present form, patch can radically reduce time to create
hashtable, but withdraws guaranty about minimum possible hashtable
But, for numbers more than 10k there is no such guarantee already,
and, actually, patch can produce more compact hashtable.
Hence, there is no downsides of using fast size search for tables
larger than 10k entries. Will this form of a patch be viable to you?

Best regards, Andrey Borodin.

More information about the nginx-devel mailing list