YounoGateway Timeout

FR;

Bonjour les amis,

Wordpress donne un délai d’expiration 504 Nginx sur les pages lourdes. J’ai essayé de prolonger le temps de faire des choses, mais cela n’a pas fonctionné. vous pourriez jeter un oeil à https://easycomp.shop/producten/ par exemple. Merci encore.

Oui, je sais qu’on a beaucoup de produits à charger.

EN:
Hello friends,

Wordpress gives a 504 Nginx timeout on heavy pages. I tried to extend the time to do stuff but that didn’t work. you could have a look at https://easycomp.shop/producten/ for example. Thank you again.

Yes, I know we got lots of products to load.

NL:
Hallo vrienden,

Wordpress geeft op zware pagina’s een 504 Nginx timeout. Ik heb geprobeerd de time to do stuff te verlengen maar dat werkte niet. zou je eens kunnen kijken op https://easycomp.shop/producten/ bijvoorbeeld. Thank you again.

Ja ik weet het we hebben nogal veel producten te ladenSchermafbeelding 2020-10-16 om 23.47.34

loadcat

Well uuuh, not sure what you’re trying to do but if you’re knowingly loading a shitload of product, that may be the root cause of the issue … If you’re in a restaurant and somebody orders a sandwich and the sandwich takes more than four hours to arrive … at some point the client times-out and leaves. But the issue ain’t “how do I make it so that the client stays longer”, the issue is “how do I make it so that the sandwich takes less than four hours to arrive”.

2 Likes

Waauw Nice way to explain it but I already told you the same kinda.

Just navigate to that url I gave you. It just times out on loading bigger lunches, to put it in your terms

Yes I do reproduce the issue but can’t really help you more than that from a Yunohost point-of-vie … dunno what exactly you did, but you should just do your stuff differently so that it doesn’t take a huge amount of time to load …

Yes you could.

Which one is right tried the most common one but nope…

There are several ways to fix it:

  • For Nginx as Proxy (php-fpm disabled) To apply settings globally, increase the following timeout values by adding the file /etc/nginx/conf.d/timeout.conf and restarting ‘nginx’ service: # cat /etc/nginx/conf.d/timeout.conf
proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

If you only are able to increase timeout settings per domain, it can be done in this way: Plesk > Subscriptions > my.domain.com > Websites & Domains > Web Server Settings – add the lines to Additional Nginx directives

  • For Nginx + FastCGI (php-fpm enabled) Increase max_execution_time setting: Plesk > Subscriptions > test.com > Websites & Domains > test.com > PHP Settings – Set max_execution_time = 300 Change request_terminate_timeout parameter (commented by default) in /etc/php-fpm.d/www.conf (for Debian /etc/php5/fpm/pool.d/www.conf ) file:
request_terminate_timeout = 300

Add fastcgi_read_timeout variable inside the ‘nginx’ virtual host configuration: Plesk > Subscriptions > my.domain.com > Websites & Domains > Web Server Settings > Additional Nginx directives

fastcgi_read_timeout 300;

Add/increase the following values in the ‘http’ section of the /etc/nginx/nginx.conf file:

fastcgi_buffers 8 128k;
fastcgi_buffer_size 256k;

Restart both ‘apache’ and ‘nginx’.

==========================================

If above steps doesn’t work, try this one…

  1. Open your nginx.conf file located in /etc/nginx directory.
  2. Add this below piece of code under http { section:
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;

Note: If its already present , change the values according.
3. Reload Nginx and php5-fpm.

$ service nginx reload
$ service php5-fpm reload

If the error persists, consider increasing the values.

=========================================

Changes in php.ini

Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):

1 max_execution_time = 150

Changes in PHP-FPM

Try raising request_terminate_timeout setting in php.ini file (CentOS path is /etc/php-fpm.d):

1 request_terminate_timeout = 150

Changes in Nginx Config

Finally, add fastcgi_read_timeout variable inside our Nginx virtual host configuration:

1

2

3

4

5

6

7 location ~* .php$ {

include fastcgi_params;

fastcgi_index index.php;

fastcgi_read_timeout 150;

fastcgi_pass 127.0.0.1:9000;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

Reload PHP-FPM and Nginx

1

2 service php–fpm restart

service nginx restart

You do not understand what’s I’m saying … the issue does not lie in nginx or php … the issue is that the application itself is taking too much time to load the data or answer the request.

When your sandwich takes four hours to be made, the issue is not that you should wait longer. The issue to be investigated is why the sandwich takes four hours to be made instead of 5 minutes. Same here : if your app takes more than 40 seconds to load the page, the issue is not “how do i make nginx/php wait more”, the issue is that at most your app should take 5 seconds to answer the request - so what’s taking so long ?

I am not sure how much items you want to load per page (I cannot load the page, at all), but I think allowing increased loading time is not the way to go.

You should have a look to Wordpress plugins that generate cache. That way, Nginx will only have to load a pre-generated static page instead of generating all the pages on-the-fly each time you have a visitor.

Consider reducing the resolution of the pictures of your products too. (Again, I have no idea what your website looks like, I cannot load it).

Hmm could try that but therefor I have to gain acces to the admin so I rather fix it on the server side. Its about a 100.000 products or something :wink:

Hmm, it doesn’t happen on other WP Sites… Any other suggests?

Check it out :smiley: I removed some shitty plugins and off we GO Thank you for helping making a dream come true! my friend, you don’t even know! How much this mean to me!

OH no issue is back :frowning: please any helps…

Can we please start over on this one, somewhere around the interwebs I found something within the config files some kind of .conf, in there where the values to up the RAM and timeout things, but now I had to restore the server to an earlier backup so I’ve kinda lost that fix :frowning:

But why are you trying to have a page showing 100 000 elements … Nobody does this. Maybe you can think “Amazon does”, but no : when a page is displayed, they show you maybe 1000 elements at most, not 100000. And internally, there are SQL requests made to only fetch 1000 elements and not 100000 otherwise it simply won’t work.

No my cat friend, it’s not about the fetching anymore it’s just for the overal stability which it had but I lost track of the file which I need to edit, could you just give me that answer?

Uuuuh naively I think you’re referring to the nginx conf, if we’re talking about wordpress it should be something like /etc/nginx/conf.d/yourdomain.tld.d/wordpress.conf

giphy-6

Now could you give me the values PHP_something_max =256M?!

Hmm still in need of that code I did stupid with the back up :worried:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.