When I run nginx -t I receive the following warning:
nginx: [warn] could not build optimal fastcgi_params_hash, you should increase either fastcgi_params_hash_max_size: 512 or fastcgi_params_hash_bucket_size: 64; ignoring fastcgi_params_hash_bucket_size
I've seen the nginx documentation and from what I can understand, this seems to be related to the number of sites (domains) that exist on the server (more than 30). I remember that I had a similar issue on my old VPS (Centos) which I solved by increasing the server_names_hash_max_size on /etc/nginx/nginx.conf. On my current setup, though, server_names_hash_max_size is already set to 2048, which seems high enough. I tried doubling it nevertheless, and I also tried setting server_names_hash_bucket_size and then restarting nginx, but both times the warning remained.
I've also seen a similar question on which it is suggested that I could try clearing the FastCGI cache or increase the "fastcgi_params_hash_max_size" in nginx.conf file. I tried the first option (webinoly -clear-cache=fastcgi and even webinoly -clear-cache=all) but the warning persisted.
As for the second suggestion, I am not sure how I could set the fastcgi_params_hash_max_size. When I add fastcgi_params_hash_max_size 2048; on my /etc/nginx/nginx.conf, nginx -t throws an error:
nginx: [emerg] unknown directive "fastcgi_params_hash_max_size" in /etc/nginx/nginx.conf
What puzzles me is the wording of the initial warning, which mentions "fastcgi_params_" instead of "server_names_" which, based on what I saw on most Google results, is the typical warning that appears on similar occasions.
I know that what nginx -t throws is just a warning and that the server still starts, but I am curious to figure it out. After a lot of searching I couldn't find anything online so I thought I 'd ask here too, in case it has something to to with some specific setting set by Webinoly.
To be honest, I have never figured it out what is wrong with this issue. Nginx documentation about this topic is very vague and unclear, also this warning seems to appear in a very random way, I have seen it in servers with 1 or 2 sites hosted. That's the reason I increased the server names variable to 2048 to prevent this issue, but it seems like now it's related to something in the FastCGI cache area.
I have tried a lot of things with no success, so definitely I have no idea about what is happening, would be great if someone can help us to understand this issue and how to prevent it.
The problem here is that fastcgi_params_hash_max_size is marked as an unknown directive.
FYI, I posted the question on Stackoverflow to get more attention. There was an answer already but I don't know how much it helps.
Thanks a lot, George!
I will keep an eye on that link, definitely, I will play and do some testing with the fastcgi_params as is suggested in the first answer, sounds logical to me.
As a sidenote on the subject, I stumbled upon this page on EasyEngine, about how to optimize server_names_hash_max_size and server_names_hash_bucket_size. So, I was wondering if instead of hardcoding those values on nginx.conf, it would be better if they were automatically adjusted every time a new site was added or removed. Of course, I don't know how easy or difficult it would be to implement or how much impact it would actually make on the overall server optimization.
Just for the record:
I found nothing about fastcgi_params_hash and in general the docs about this specific topic is not so clear.
I hope in the future we can find something to know how to prevent this warning message.
PayPal · GitHub Sponsors · Bitcoin