WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again
-
We have a WordPress site that we host and it is running fast, no particular issues, but every several hours the site goes into maintenance mode, on its own, for no obvious reason and then comes back all happy as a clam.
I can only guess that this is some kind of plugin attempting to do an update or something on a recurring basis that doesn't work and when it fails, it reverts and all is otherwise well?
Site is production so we can't completely offline it for testing. Anyone seen something like this before?
Some quick details...
- WP is fully up to date as are all available plugins and themes.
- Execution is PHP 8.0 on Apache (will be updated very soon)
- Varnish cache is in use.
- Nginx reverse proxy.
- CloudFlare is full proxy as well.
- Site is years old, not something new.
-
I should mention that no other site on the server is having a similar problem.
-
Maybe you solved the problem by now, but every time wordpress runs a scheduled update check it will display this notification.
You should be able to trigger the update manually from the site. Or change so it runs at a known time (or just look for a file in the web root for a file called
.maintenance
).I don't know if the update process has a log file (doesn't look like it has) but otherwise run tcpdump/wireshark to look at the traffic when it does it's update.
Since it takes 10 minutes every time there is probably something that fails and timeout.
-
@scottalanmiller If the timing is regular then look for a chron job running at that time. Or, is it "cron"? Meh ... *NIX skillset is pretty green.
-
@PhlipElder said in WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again:
@scottalanmiller If the timing is regular then look for a chron job running at that time. Or, is it "cron"? Meh ... *NIX skillset is pretty green.
We found it. Basically what it was was....
A PHP cycle job for a plugin to auto-update. But the plugin had some problem and couldn't update and would fail. So it never stopped attempting to update and it went into this death spiral that every ~12 hours or so, it would do this thing, kill the site for 9 minutes, and give up and return to normal.
So cron-like job, but seems to have been PHP-Cron or similar.
-
@scottalanmiller There are auto updates also if you enabled that on the plugin will do it.
-
@scottalanmiller said in WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again:
@PhlipElder said in WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again:
@scottalanmiller If the timing is regular then look for a chron job running at that time. Or, is it "cron"? Meh ... *NIX skillset is pretty green.
We found it. Basically what it was was....
A PHP cycle job for a plugin to auto-update. But the plugin had some problem and couldn't update and would fail. So it never stopped attempting to update and it went into this death spiral that every ~12 hours or so, it would do this thing, kill the site for 9 minutes, and give up and return to normal.
So cron-like job, but seems to have been PHP-Cron or similar.
It WP-cron that I also linked to in an earlier post.
Basically it's WP's version of the system cron job.
Difference is that WP was made to run on shared servers without having access to the underlaying OS. So for each web page access WP will check if it also has to run some scheduled job as well.
After it has done that it waits 12 hours by default until next time. WP can only run you have a web page request executing it so you can't predict exactly when it's going to happen.
The real solution is to invoke scheduled jobs from the OS and only do so during the night or whenever it is suitable since WP shuts down the site when doing upgrades.
This is how you do that:
https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/ -
@Pete-S said in WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again:
This is how you do that:
https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/Nice, good info. Thanks.