Get the most out of your Centmin Mod LEMP stack
Become a Member

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 Premium Member Premium Member

    222
    23
    18
    Apr 11, 2015
    Ratings:
    +51
    Local Time:
    11:09 AM
    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

    36,023
    7,901
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,183
    Local Time:
    6:09 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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 Premium Member Premium Member

    222
    23
    18
    Apr 11, 2015
    Ratings:
    +51
    Local Time:
    11:09 AM
    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

    36,023
    7,901
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,183
    Local Time:
    6:09 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Glad to hear :)
     
..