MagnaCapax / PMSS

Pulsed Media Seedbox Software
GNU General Public License v3.0
19 stars 3 forks source link

lighttpd/php crashes occasionally, resulting in 502 #34

Open MagnaCapax opened 7 months ago

MagnaCapax commented 7 months ago

PHP implemention is a bit flaky. probably check if different module OR build a watchdog to check for PHP actually working and restart if not. built-in doesn't function.

Suspecting rtorrent api is causing these crashes by hanging in one or another.

gstrauss commented 7 months ago

lighttpd is not crashing. The PHP may be crashing and lighttpd is returning 502 Bad Gateway. Check the lighttpd error log (or breakage log, if configured) and post here the PHP errors from the log.

MagnaCapax commented 7 months ago

lighttpd is not crashing. The PHP may be crashing and lighttpd is returning 502 Bad Gateway. Check the lighttpd error log (or breakage log, if configured) and post here the PHP errors from the log.

you are absolutely correct. This is mentioned in the original issue.

Logs show nothing but that it had crashed. This is very long running issue and might be due to fcgi (not fpm) + something with using socket file for rtorrent xmlrpc-api, which does regularly stop responding in a manner that does not give timeout issue but locks things up, while not crashing rtorrent itself, necessitating rtorrent to be restarted as well.

Every sort of debug mode for fcgi has been attempted with no clues.

So i believe first attempt should be to change over to php-fpm over fcgi OR figuring out why fcgi/lighttpd does not restart crashed processes.

Lighttpd indeed remains up, it's only fcgi which crashes and does not restart -- tho apparently it should by default automatically restart.

gstrauss commented 7 months ago

Please remove lighttpd from the title, as lighttpd is not crashing, and you know that lighttpd is not crashing, but the title implies that lighttpd/php is crashing.

From your description, it does not sound like PHP is crashing either, but rather that something in the PHP is locking up or blocked, and then not responding.

If PHP were to crashes and lighttpd was configured to start the PHP fastcgi, then when the PHP fastcgi process exits, lighttpd will restart the PHP fastcgi process. If the PHP fastcgi process does not exit, lighttpd will not restart it.

lighttpd does not perform health checks on the backend PHP fastcgi process, as the application developer is better equipped to write an appropriate health check and to take appropriate action if the health check fails or times out.