[Snapshot Pro] Snapshot using a lot of CPU resources

I had emails from hosting company over the weekend saying I was close to using up my CPU requests limit. They sent me the email below with info which points at Snapshot as being 'to blame'. I've used Snapshot on this site for several months with no problems and it's been fine for a day or so since the incident. Any ideas why it might have triggered so many CPU requests that one day?
--
Thank you for the patience.

I am sorry for the delayed response.

I investigated your case carefully and found out that just today to your site there were around 40 000 requests.

This was also true for your other website on your other account.

Please be advised that a request is essentially a script execution, which generates a CPU usage. High number of request can lead to high CPU usage and high server load.

I checked both of the accounts' access logs and found out that the majority of the requests were made by a plugin on your applications which is generating backups of your sites:
Code:
77.104.133.148 - - [11/May/2018:02:36:25 +0100] "POST /wp-admin/admin-ajax.php?action=snapshot-full_backup-respawn_cron&doing_wp_cron=1 HTTP/1.0" 200 - "https://www.scgp.org.uk/wp-admin/admin-ajax.php?action=snapshot-full_backup-respawn_cron&doing_wp_cron=1" "WordPress/4.9.5; https://www.scgp.org.uk"

77.104.133.107 - - [11/May/2018:02:33:37 +0100] "POST /wp-admin/admin-ajax.php?action=snapshot-full_backup-respawn_cron&doing_wp_cron=1 HTTP/1.0" 200 - "https://www.jessicafearnleybusinessconsulting.com/wp-admin/admin-ajax.php?action=snapshot-full_backup-respawn_cron&doing_wp_cron=1" "WordPress/4.9.5; https://www.jessicafearnleybusinessconsulting.com"

In this case please either deactivate the plugin or contact the plugin's support and ask them how you may decrease the activity of the said plugin to not make this high amount of requests to the account generating a high CPU usage in the process.

For any additional assistance, please do not hesitate to contact us.

Best Regards,

Donetian Petkov
Technical Support Team

  • Oguz

    Hey Jon ,

    Hope you're well.

    If your site is getting bigger every day or you upload something big maybe can cause similar issues. Can you try to add these codes to your wp-config.php file?

    /* Snapshot Settings */
    define('SNAPSHOT_FILESET_CHUNK_SIZE', 10);
    define('SNAPSHOT_TABLESET_CHUNK_SIZE', 100);
    define('SNAPSHOT_FILESET_LARGE_FILE_SIZE', 104857600); // skip files over 100mb
    define('SNAPSHOT_FILESET_USE_PRECACHE', true); // try false or true
    define('SNAPSHOT_FORCE_ZIP_LIBRARY', 'pclzip'); // try pclzip or ziparchive
    define('SNAPSHOT_ATTEMPT_SYSTEM_BACKUP', true);
    define('SNAPSHOT_IGNORE_SYMLINKS', true);
    /* End of Snapshot Settings */

    It will make some tuning on your Snapshot settings, then maybe you can run one more backup and compare results with your hosting company.

    I hope it helps!

    Cheers,
    Oguz

  • Jon

    Thanks, a few backups have run fine since this incident with no CPU request limit being reached so I wonder if it's maybe more likely something server related at my end or just a little blip with the communication leading to lots of requests?

    I think the former seeing as it hit for both of these sites on the same day which are on the same server and my other sites were all fine (on a different server).

  • Dimitris

    Hello Jon,

    hope you're doing good today! :slight_smile:

    Another thing that I'd like to mention is the possibility that 1st site's backup process is also including second site. This can be happening, if second site's folder is nested inside the first site's folder, for example:
    /public_html/ (1st site)
    /public_html/domain.com/ (2st site)

    In a case like this and if you don't have setup any Global Exclusions in Snapshot -> Settings, when 1st site backs up (via Managed Backups), it will include all folders and files that's in the root folder of the installation, including the files/folders of 2nd site, which could lead in extensive resource usage.

    You can surpass that by using this setting:

    Warm regards,
    Dimitris