wp-media / backwpup

BackWPup - WordPress Backup Plugin
https://backwpup.com
GNU General Public License v2.0
88 stars 35 forks source link

wp-cron job seems to be sucking server GPU #73

Closed baerkins closed 3 years ago

baerkins commented 6 years ago

A client was having problems with high amounts of GPU being consumed by wp-cron.php on their site. In a effort to test what was going on, I ran several wp-cron jobs, and the phone_home cron from this plugin returned a nonce error. I disabled the plugin, and GPU usage dropped dramatically (see attached). Not sure what or how, but it seems like that nonce error was an issue for sure. My bet is that the error occured and it kept trying to fire over and over.

Just wanted to make you aware of the issue...let me know if you need any further information.

Running plugin v3.5.1 on WP v4.9.6, server is running php 7.0.6

image 2018-06-12 at 10 51 24 pm

cuongdcdev commented 6 years ago

@baerkins on the latest version 3.6 now, did you got this issue?

dabernathy89 commented 5 years ago

This is still an issue. In production, i'm seeing this cron job run on what appears to be every request (or in my case every minute when i'm triggering WP Cron manually).

I don't know for sure why this is happening, but my best guess is that it's because this line is running immediately upon the plugin being loaded (from the main plugin's constructor), and not from a WP hook:

if ( ! wp_next_scheduled( self::HOOK ) ) {
    wp_schedule_event( time(), self::RECURRENCE_KEY, self::HOOK );
}

https://github.com/inpsyde/backwpup/blob/master/vendor/inpsyde/phone-home-client/src/CronController.php#L56-L58

I'm wondering if wp_next_scheduled is returning false because it's too early in the process?

DavidAnderson684 commented 3 years ago

I am seeing this issue on a site too. Plugin version 3.8.0.

cuongdcdev commented 3 years ago

@DavidAnderson684 This issue should be resolved by disable phone home client in BackWPUp -> Settings ^^