Webinoly is just the perfect tool for NGINX experts. Give it a try!
0 votes
2.5k views
by Talented
I am getting regular 504 gateway errors from NginX when updating 20+ of the 1,000 or so WooCommerce products on my site, at the same time. My idea was to increase the following timeout values by adding the file `/etc/nginx/conf.d/timeout.conf` and restarting the NginX service.

proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

This would apply it globally, so I would prefer to make this 'fix' on a per-domain basis. How should I do this with Webinoly, or maybe this is not the correct fix, or the way to do it.

Your advice, as always, would be much appreciated.

1 Answer

0 votes
by Expert

Hi Terence,

Whatever you put in conf.d folder will have a global effect, Webinoly have support for Custom Nginx rules per site, for example: /var/www/domain.com/custom-nginx.conf, you can read about this feature, here: https://webinoly.com/en/documentation/sites/#nginx

I don't think that Proxy Nginx directives will solve your issue (I may be wrong), because your WordPress sites are not using the Reverse Proxy configuration in Nginx.

What I recommend in this case, is that first of all you should check the PHP logs and of course Webinoly have support for it: sudo log -php, because I think PHP is not responding for some reason. We have two variables for this:

  • max_execution_time  (/etc/php/7.3/fpm/php.ini)
  • request_terminate_timeout (/etc/php/7.3/fpm/pool.d/www.conf)

Both of them are set to a value of 300 seconds (5 minutes), so I think that this time is more than enough to process almost any individual request, for this reason, I think this is not the cause of your issue, but you should consider it. 

If you prefer, you can found the PHP logs here: /var/log/php/7.3/fpm.log for more details.

Also, we have an NGINX directive fastcgi_read_timeout (/etc/nginx/conf.d/fastcgi.conf) that we have set to 30 seconds, maybe you should try increasing this value. Don't forget to restart Nginx to changes take effect sudo nginx -t && sudo service nginx reload.

Finally, you should check your server resources, maybe its time to migrate to a bigger server.

Please, tell me if you have any additional question and keep me posted if you solve this issue.

Regards.

by Talented
edited by

Many thanks for your detailed reply. You may well be right about the server resources. On a VPS that's easy to fix ~ just needs a little more money each month ~ but first I thought I'd take your advice and look at `fastcgi_read_timeout` and see what's cooking there.

I am now getting this 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`

...but when I look there is no `fastcgi_params_hash_max_size` either in the nginx.conf or the `/etc/nginx/conf.d/fastcgi.conf` or `/etc/nginx/nginx.conf` files.

I also read your earlier messages about `fastcgi_params_hash_max_size` is marked as an unknown directive. 

So now I am really confused. Can you shed some light on the matter?

by Expert
Don't worry about that "Warning", I understand it's totally annoying but it has been appearing in a random way. To be honest, I still don't know the cause of this message, but I'm sure is completely inoffensive and it does not represent any risk to your server.

I'm investigating this issue!
by Talented
Its strange because it continues even if you reset the directive back to the original 30 seconds. No doubt I'll read about it being fixed one day, but until then I won't worry about it.

Thank you for your help.
by Talented

In the meantime the constant 504's are slowing my workflow to a crawl so I am going to upgrade the server as I don't think its quite up to the job of handling 1,000 products in WooCommerce.  

Here's what the metrics look like...

by Expert
Nothing wrong in your metrics!

Any clue in PHP logs?
by Talented
There are notices and warnings but I am trying but I think I am kidding myself if I think I understand it all.

Can I email it to you and get you to help me with it please?  If so, what address do I use?
by Expert
Yes, send it, you have my email address.
by Talented

It turned out to be a PHP problem generated by a plugin which is not 7.3 compatible, which explains the other errors we were seeing.  The advice I got from the author was "PLease switch the PHP version to 7.1. It will solve the issue."  When I did that it started to run as it should do. Its a shame really because that means quite a performance hit which I have seen on my page load speed. Hopefully he will get with the program eventually.

by Expert

Glad to see your issue solved!

  • The BAD: You should try to avoid using "poorly coded" plugins.
  • The GOOD: With Webinoly is really easy switch the PHP versión.
Regards.
by Talented
edited by

As always, thank you for your excellent help.

P.S. Sometimes poorly coded plugins are all us non-developers have to choose from. laugh

by Expert

Hi Terence,

Just came to my mind this issue now when I saw that PHP 7.1 will be EOL (End Of Life) in 2 more weeks (Dec 1st), which means that no updates and not even security patches will be released after this date.

You should plan your upgrades to 7.3.

Regards.

by Talented
Thanks for remembering me.  I have written to them but I am not hopeful of hearing anything positive. In fact I am not hopeful of hearing anything. Their actions and attitudes appear to me to be more like a company with a business model of "price low and provide minimal support". They stand in stark contrast to you and Webinoly.
by Rookie
edited by

I have a page with multi folder on my website, I want to show it but can not. I check in log -php:

[18-Apr-2023 22:52:46] WARNING: [pool www] child 3832793, script '/var/www/mywebsite.com/htdocs/index.php' (request: "POST /index.php?module=fileman&section=get&page=tree") execution timed out (67.891320 sec), terminating

[18-Apr-2023 22:52:46] WARNING: [pool www] child 3832485, script '/var/www/mywebsite.com/htdocs/index.php' (request: "POST /index.php?module=fileman&section=get&page=grid") execution timed out (67.891293 sec), terminating

How can I increase execution time load a page in webinoly, not only 67 sec?

I follow edit parameter like QROkes guide but not successfull, still about 60-70s to terminate.

How can I do to load the page?

Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

To report a bug, please create a new issue on GitHub or ask a question here with the bug tag.
Webinoly Support Paypal Donations

PayPal · GitHub Sponsors · Bitcoin

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...