Re: Use primes for hashtable size

2017-06-04 Thread Andrew Borodin
2017-06-04 8:35 GMT+05:00 Mathew Heard : > 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

Re: Use primes for hashtable size

2017-06-02 Thread Andrew Borodin
Hello world! 2017-06-02 16:46 GMT+05:00 Maxim Dounin : > Hello! > > On Fri, Jun 02, 2017 at 10:56:31AM +1000, Mathew Heard wrote: > >> If this actually yields a decrease in start time while not introducing >> other effects we would use it. Our start time of a couple minutes is >> annoying at times

Re: Use primes for hashtable size

2017-06-02 Thread Mathew Heard
We are loading around 10,000 - 15,000 server_names per server. We also have a fair number of SSL certificates and at-least one big geo map as well which probably do contribute. At around 2,000 - 3,000 we hit our first issues with server_name and had to alter the hash table max. Which brought the l

Re: Use primes for hashtable size

2017-06-02 Thread Maxim Dounin
Hello! On Fri, Jun 02, 2017 at 10:56:31AM +1000, Mathew Heard wrote: > If this actually yields a decrease in start time while not introducing > other effects we would use it. Our start time of a couple minutes is > annoying at times. Do you have any details of what contributes to the start time

Re: Use primes for hashtable size

2017-06-01 Thread Mathew Heard
If this actually yields a decrease in start time while not introducing other effects we would use it. Our start time of a couple minutes is annoying at times. On Fri, Jun 2, 2017 at 3:57 AM, Andrew Borodin wrote: > 2017-06-01 22:39 GMT+05:00 Maxim Dounin : > > Thanks, though suggested change wil

Re: Use primes for hashtable size

2017-06-01 Thread Andrew Borodin
2017-06-01 22:39 GMT+05:00 Maxim Dounin : > Thanks, though suggested change will certainly modify current > nginx (documented) approach of searching for minimum possible > hash sizes. > > It might be a better solution for large hashes though, as > currently optimized by using a larger start size: >

Re: Use primes for hashtable size

2017-06-01 Thread Maxim Dounin
Hello! On Thu, Jun 01, 2017 at 04:54:50PM +0500, Andrew Borodin wrote: > Hi, Maxim! > > 2017-05-30 18:01 GMT+05:00 Maxim Dounin : > > > > The maximum size of hash table as specified by the hinit->max_size > > field is indeed maximum size, and not the size of the hash table. > > Following code in

Re: Use primes for hashtable size

2017-06-01 Thread Andrew Borodin
Hi, Maxim! 2017-05-30 18:01 GMT+05:00 Maxim Dounin : > > The maximum size of hash table as specified by the hinit->max_size > field is indeed maximum size, and not the size of the hash table. > Following code in the ngx_hash_init() will try hard to find to > find out an optimal hash size for a giv

Re: Use primes for hashtable size

2017-05-30 Thread Maxim Dounin
Hello! On Tue, May 30, 2017 at 03:28:03PM +0500, Andrew Borodin wrote: > Hi, nginxers! > > We often use hashtable sizes equal to the power of 2. This can be > damaging for a hashtable. I haven't found any mitigation for this in > nginx code. So I made my own. If this issue is addressed somewhere

Use primes for hashtable size

2017-05-30 Thread Andrew Borodin
Hi, nginxers! We often use hashtable sizes equal to the power of 2. This can be damaging for a hashtable. I haven't found any mitigation for this in nginx code. So I made my own. If this issue is addressed somewhere just ignore my message. Or I'd be happy if someone will point me it. For the expl