Discover Centmin Mod today
Register Now

Nginx nginx: [emerg] could not build map_hash, you should increase map_hash_bucket_size

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by negative, Dec 10, 2015.

Tags:
  1. negative

    negative Member

    212
    20
    18
    Apr 11, 2015
    Ratings:
    +48
    Local Time:
    5:40 PM
    1.9.10
    10.1.11
    Hello

    I have created a custom rewrite list including 500 url to new urls manually. And i set the map module in the nginx.conf. But when i include these URLS, nginx cant restart

    Nginx gives error (via journalctl -xn) that:

    I didn't find map_hash_bucket_size in the nginx.conf but i tried to add these value. But if i put this variable to nginx.conf, nginx gives error again what about "duplicate entry bucket_size" So where store this value i didnt understand ?

    Also, i tried that if i run 60 URL's for rewrite, nginx restarting and runs without problem. But if i enter more than 64, i need increase this. So, if i have 500 URL, must i change this value to 512 ? And how ?

    Thanks.
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    12:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    see Module ngx_http_map_module
    as to cache line size see and install hwlock hwloc and lstopo | Centmin Mod Community

    or

    Code:
    cat /proc/cpuinfo
    not sure if it's related to
    Code:
    cache_alignment : 64
    try in nginx.conf within http {} server context
    Code:
    map_hash_bucket_size 128;
    or
    Code:
    map_hash_bucket_size 192;
    or
    Code:
    map_hash_bucket_size 256;
    and Setting up hashes

     
  3. negative

    negative Member

    212
    20
    18
    Apr 11, 2015
    Ratings:
    +48
    Local Time:
    5:40 PM
    1.9.10
    10.1.11
    Hello

    I put the map_hash_bucket_size 128; to top of the http{} section in nginx.conf and problem is fixed. Nginx has restarted without problem and rewrite rules working like a charm. Thanks ...
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    12:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    Glad to hear :)