Want to subscribe to topics you're interested in?
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 Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    6:18 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

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    6:18 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 ...
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:18 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Glad to hear :)