New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
plesk 502 bad gateway
Hi everyone
I have plesk installed (nginx+php-fpm) on my cloud vps and I am running into a problem while testing the site load with blitz.io. After 80 hits the site returns 502 bad gateway, so I guess somewhere is set up to serve up this number but i can't find where to increase it.
I tried few options including adding this in the nginx config
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
nothing works so far, maybe its the apache side but I don't know if this can happen from serving request to nginx.
Does anybody have a suggestion?
Comments
Seems not nginx, but you can try to increase php-fpm pool setting
ok so for every site there is a config which says do not edit here, where would be the place to change these settings and which options should I increase?
This would probably be a good place..
; If you need to customize this file, use either custom PHP settings tab in
; Panel or override settings in /var/www/vhosts/system/mysite.com/conf/php.ini.
; To override pool configuration options, specify them in [php-fpm-pool-settings]
; section of /var/www/vhosts/system/mysite.com/conf/php.ini file.
Also; you might not want to run php-fpm as root
@xDutchy silly me for not reading the rest of it.
>
this was set by plesk not by me
That's quite... curious?
I'd love to find a vurnerable WordPress install on such a Plesk server, having fun all day by uploading php scripts and running shell executes
whats more funny
this file does not exist in the directory
this does not make me happy at all, going downhill after 82 concurrent users
@vladimir Did you check
top
andfree -m
when you were performing the test?@forthcloud yes and there is only 3mb increase of memory, usually idles at 160mb of 1GB, i have 3 websites and only the one under load returns 502, the other 2 work fine.
Can you please check your Apache Logs and PHP-FPM logs?
The following commands should also help:
Found the problem
Replace the "mysite.com" with your own domain.
/var/www/vhosts/system/mysite.com/conf/php.ini
@forthcloud That was fine, i just replaced in the post so my domain stays private
however my nginx config file was lacking worker_rlimit_nofile option
I added it now and Im going to test again.
thanks
still same
nginx 502 Bad Gateway
and same message
The first timeout happened at 5 seconds into the test when the number of concurrent users was at 82.
I feel I am hitting in the wrong place all the time
What type of content are you hosting?
@forthcloud php sites
I know this is comming from plesk since I have worked on many enterprise solutions and I know what I am doing, the problems lies somewhere in plesk but where exactly... the configs are mixed up and scattered all over so Im having a hard time finding the right place.
one thing I know for sure now is that plesk isolates configs and processes for each site since only one site goes down and the others work fine.
Have you checked
/var/log/sw-cp-server/error_log
? If you can submit a ticket, we will log in to your server and fix it for you.@forthcloud that log is empty, and although I am very grateful to you i ordered unmanaged service, i don't expect you to fix these issues for me, on the other hand I also want to learn how to fix problems my self :P
btw the nginx error log is pretty heavy - 30mb
the problem lays somewhere here
@vladimir Try to edit /etc/nginx/nginx.conf file and add following value, then restart.
@forthcloud still same result
I also turned off nginx to serve php scripts by apache and the result is 82 users = 500 HTTP Internal Server Error, Instead of Bad Gateway
memory used 360mb
UPDATE: this guy has same problem http://forum.parallels.com/pda/index.php/t-289980.html
http://stackoverflow.com/questions/10003978/php-fpm-and-nginx-502-bad-gateway
http://stackoverflow.com/questions/8772015/502-gateway-errors-under-high-load-nginx-php-fpm
--UPDATE--
problem solved a while ago, just increase php-fpm max child processes.