What is causing the 504 Gateway Timeout error?
check out error.log
> [error] 7036#0: *75024 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "PURGE /section/supercar.html HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"
how can I solve this issue?
7 Replies
and this one
I am using two 512 linode. One for app the other for database.
The site is on wondpress under the heaviest loads I was using more than 485MB of the allocated RAM. Usually, though the site pushes 400MB.
I got php5-cli php5-cgi psmisc spawn-fcgi installed. Also, I am using nginx,fastcgi, php5-fpm, varnish, apc
/usr/bin/php-fastcgi:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 6 -u $FASTCGI_USER -f /usr/bin/php5-cgi
maybe up the children 6 at a time ???
since, I am using APC and php5-fpm… is there a way not to have kill the children when they reach a specified number of requests and respawn fresh ones
PURGE /section/supercar.html HTTP/1.0
Something is sending 'purge requests to php' I guess. To be honest with you, I don't even know what that means. I just took settings for php5-fpm, varnish, apc etc from here and there to speed up the server.
When I get heavy load on the server, it gets time out. The time out could be normal, however, when I look at the error log, I see it gets stuck somewhere.
If you answer a few questions I'll be able to give better advise.
1) What web server are you running
2) Why are you using PHP-FPM and how did you install it
3) What software are you running i.e wordpress/drupal etc
4) What's your database back end? i.e MySQL
1) What web server are you running
ubuntu 10.04 - nginx, php5-fpm, varnish, wordpress plugin w3tc (total cache), apc. I also have memcached, and php5-memcache installed. However, since I have 'one app server' memcache isnt active at the moment.
I am wondering if I should install apache2 and have nginx in the front. Any thought on this?
I used these three links. They are similar to each other, one covers more information on what others lack.
my settings are combination of those set ups. If you require, I will post my own settings.
I believe it was fast when I solely used danielmiessler's link. When I mix it with tutspundit set up, I think server slow down a bit. However, I didn't benchmark it piece by piece. It is just an overall observation at the moment. I hoped that when the server hits heavy load, it will stay up and serve properly. So, I hope tutspundit's setting provided a better robustness.
I have two 512MB servers. One app server, and the other data server. Eventually, I will add one more app server, and balance it with node balancer.
2) Why are you using PHP-FPM and how did you install it
I need the site to fly without hick ups. The site was slow with Apache, and the server prone to crash on load. When I was on apache, I had everything on the same server. The data, and the app were on the same server without any optimization. I separated the app and the data to two separate servers and opted for nginx instead of apache. Nginx wasnt amazing out the box, but the cpu, memory, and IO rate was lower. So, I decided to bite the bullet to see how much I can squeeze started to optimize the set up.
10.04 server doesn't use php5-fpm. So, I grabbed it from ppa repo and installed it. Using ppa repo isn't highly recommended since it is not in the official release cycle, and several other issues. However, I might get the latest ubuntu distro since it has the latest php5 compare to 10.04 stable release.
3) What software are you running i.e wordpress/drupal etc
wordpress
4) What's your database back end? i.e MySQL
separate stand alone 512 server. This server only has mysql on it.
I really appreciate your help.