Jeremy Davis's picture

I suspect that the best place to start would be the Apache logs. Depending on how you have your sites set up, they may be logging to individual files (one per "site"), or into a combined log (default), or a combo of both. Regardless, you should find them all in /var/log/apache2.

At the very least, that should at least give you some hints on what might be going on. I would also suggest that you check on system resources (e.g. RAM, CPU and free disk space). Judging from your post, those actually all look ok, but it's well worth watching it and comparing to when the issues actually occur. Issues with any of those being exhausted will cause weird intermittent issues, but often after what ever was causing the issue crashes, the resource usage will go back to usual. The fact that it's using any swap at all suggests that it has been swapping at some point (and thus likely running out, or at least running low on physical RAM).

Having said all that, a 5xx error (e.g. a 500 error) is usually related to the application, rather than the webserver itself (so something going wrong with WordPress itself - which may or may not be linked to lack of resources).

So to really track down the cause of the issue, you may need to dig a little deeper and enable PHP debugging/logging so that you can get a bit more clarity on what is actually going wrong.

I doubt that it's at all related, but you note use of MySQL 5.7. Seeing as that is not available from Debian (Jessie; the basis of v14.x only had MySQL 5.5), I can only assume that you have installed that from elsewhere. So even though it seems highly unlikely that would cause 500 errors, perhaps it's also worth double checking that that is working as expected (and not logging any errors).

And whilst it is unlikely to automagically resolve your immediate issues, it may be worth considering moving to v15.x. Debian Stretch (basis of v15.x) includes PHP7.0 and lots of users have reported their sites working much better/quicker with the newer version of PHP.

Please feel free to share any logs and/or info if you want further input.