ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    WordPress Site Lost Its Mind - Ten Minutes of Maintenance Over and Over Again

    IT Discussion
    wordpress nginx varnish cloudflare apache php
    4
    8
    645
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      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.

      Screenshot 2023-01-28 at 5.11.29 PM.png

      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.
      1 PhlipElderP 2 Replies Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        I should mention that no other site on the server is having a similar problem.

        1 Reply Last reply Reply Quote 0
        • 1
          1337 @scottalanmiller
          last edited by 1337

          @scottalanmiller

          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.

          1 Reply Last reply Reply Quote 0
          • PhlipElderP
            PhlipElder @scottalanmiller
            last edited by PhlipElder

            @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.

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @PhlipElder
              last edited by

              @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.

              dbeatoD 1 2 Replies Last reply Reply Quote 1
              • dbeatoD
                dbeato @scottalanmiller
                last edited by

                @scottalanmiller There are auto updates also if you enabled that on the plugin will do it.

                1 Reply Last reply Reply Quote 1
                • 1
                  1337 @scottalanmiller
                  last edited by 1337

                  @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/

                  scottalanmillerS 1 Reply Last reply Reply Quote 1
                  • scottalanmillerS
                    scottalanmiller @1337
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post