getting types_hash_max_size error in /var/llog/nginx/error.log when restarting nginx

Basid Rahman asked:

I ma getting the below error in /var/log/nginx/error.log file:

2017/02/07 16:18:53 [warn] 775#0: could not build optimal types_hash, you should
increase either types_hash_max_size: 2048 or types_hash_bucket_size: 64; ignori
ng types_hash_bucket_size

I have already checked nginx.conf it has the following value

types_hash_max_size 2048;

How can I know the current value of types_hash_max_size and types_hash_bucket_size from the linux and how to resolve the above issue.

Any help will be highly appreciated!


My answer:

The warning message shows the current value, not the suggested value.

In case you get this warning, you should set the value to double its existing value, which should be a power of 2. And as explained in the documentation, if you are warned about two values, you should increase hash max size first.

types_hash_max_size 4096;

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.