Virtualmin Crashing Every 2 Hours

Ubuntu 16.04, Nginx Virtualmin GPL

Every 2 hours or so, I get a notification that MySql is down, and then all of the sites go down. All of the sites when accessed have the “Bad Gateway” page. When this happens, I also cannot access the Virtualmin Panel, and often cannot SSH in, forcing me to reboot from the VPS hosting panel. After I reboot, everything is fine for a couple of hours. I can’t find anything in logs, but perhaps I am looking in the wrong place.

I’ve had low resource problems before, but never like this. The only thing that changed before this started happening, is that I removed a bunch of old PHP versions.

What should I be looking at?

I had an issue a while ago where i removed a php version.

Type ps ax | grep php

Look for lines like bash -c PHPRC=/home/user/etc/php7.3 PHP_FCGI_CHILDREN=4 /usr/bin/php-loop.pl /bin/php-cgi7.3 -b /var/php-nginx/1613xxxxxxx839.sock/socket >>/home/user/logs/php.log 2>&1 </dev/null

Where it’s running for a php version not installed.

It was causing an endless loop of those processes exhausting the server.

Then go to Webmin → System → Bootup and shutdown, find the correspondent service and disable it.

I did find things like this:

1701 ? S 0:00 /usr/bin/perl /usr/bin/php-loop.pl /usr/bin/php-cgi7. 2 -b /var/php-nginx/154782151331016.sock/socket

But I did not see any corresponding service in Bootup and Shutdown.

I looked a bit more closely. It turns out that one of 15 accounts had not had the PHP choice explicitly set. The Virtualmin Form showed PHP8.0, but I have not yet chosen that for any account, which means that the form defaulted to the latest, but in actuality, the account was still set for the non-existent 7.2. I explicitly set the PHP to 7.4 for that account, and rebooted, and all of the 7.2 processes were gone. I am holding my breath that this actually solves the problem, but so far so good…

1 Like

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