Welcome! Log In Create A New Profile

Advanced

Re: Use primes for hashtable size

Andrew Borodin
June 01, 2017 01:58PM
2017-06-01 22:39 GMT+05:00 Maxim Dounin <mdounin@mdounin.ru>:
> 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:
>
> if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) {
> start = hinit->max_size - 1000;
> }

Yeah, maybe put the primes loop under if.

> Not sure it is at all needed though, as I don't remember any
> "words about startup speed" in the documentation and startup
> speed of hashes wasn't a practical problem as far as I remember.


Here https://nginx.ru/en/docs/http/server_names.html
"if nginx’s start time is unacceptably long, try to increase
server_names_hash_bucket_size" It's about allowing more hash
collisions.
But I do not insist, though :) I've done the patch jut for fun

Best regards, Andrey Borodin, Octonica.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Use primes for hashtable size Attachments

Andrew Borodin 744 May 30, 2017 06:30AM

Re: Use primes for hashtable size

Maxim Dounin 495 May 30, 2017 09:04AM

Re: Use primes for hashtable size

Andrew Borodin 488 June 01, 2017 07:56AM

Re: Use primes for hashtable size

Maxim Dounin 455 June 01, 2017 01:40PM

Re: Use primes for hashtable size

Andrew Borodin 434 June 01, 2017 01:58PM

Re: Use primes for hashtable size

splitice 555 June 01, 2017 08:58PM

Re: Use primes for hashtable size

Maxim Dounin 397 June 02, 2017 07:48AM

Re: Use primes for hashtable size

splitice 565 June 02, 2017 07:52AM

Re: Use primes for hashtable size

Andrew Borodin 466 June 03, 2017 02:02AM

Re: Use primes for hashtable size

Andrew Borodin 475 June 04, 2017 02:24PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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