siteground is recommending 30 min. cron jobs – will this affect updraft?

UpdraftPlus Home Forums Paid support forum – UpdraftPlus backup plugin siteground is recommending 30 min. cron jobs – will this affect updraft?

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #173467
    Ryan
    Participant

    I’ve been experiencing issues of high resource usage on my Siteground cloud account, and they’re recommending I set up cron jobs in cPanel. Their full response is below. My question: will this affect my updraft backups? Thank you

    – – –

    Almost all WordPress websites run wp-cron.php after each execution of the index.php file. For example:

    Code:

    [2016-09-21 07:51:02]: info: [usr/grp]: xx cmd: /home/xx/public_html/index.php php: /usr/local/php54/bin/php
    [2016-09-21 07:51:02]: info: [usr/grp]: xx cmd: /home/xx/public_html/wp-cron.php php: /usr/local/php54/bin/php
    
    [2016-09-21 07:51:06]: info: [usr/grp]: xx cmd: /home/xx/public_html/index.php php: /usr/local/php54/bin/php
    [2016-09-21 07:51:07]: info: [usr/grp]: xx cmd: /home/xx/public_html/wp-cron.php php: /usr/local/php54/bin/php
    
    [2016-09-21 07:51:08]: info: [usr/grp]: xx cmd: /home/xx/public_html/index.php php: /usr/local/php54/bin/php
    [2016-09-21 07:51:09]: info: [usr/grp]: xx cmd: /home/xx/public_html/wp-cron.php php: /usr/local/php54/bin/php

    For example almost 25% of the executions for a day are made towards the wp-cron.php file:

    Code:

    root@c22144 [/home]# cat /usr/local/apache/logs/suexec_log.1 | wc -l
    24334
    root@c22144 [/home]# grep "wp-cron.php" /usr/local/apache/logs/suexec_log.1 | wc -l
    7666

    There is an easy resolution of the problem. Instead of running frequent scripts executions towards this file you can set cron jobs through:
    cPanel->Cron Jobs.

    This is explained in details in our WordPress tutorial:
    https://www.siteground.com/tutorials/wordpress/setup-cron-job.htm

    Configuring each cron job to run once on every 30 minutes should be enough.

    #173493
    udadmin
    Keymaster

    I don’t think you’ve been given good advice there – it addresses the symptoms, rather than the cause.

    WP self-calls wp-cron.php, if there are overdue cron events. It won’t call itself loads of times, unless there are overdue scheduled tasks. Restricting the calling of wp-cron.php to 30 minutes will just mean that you have many more unserviced scheduled tasks.

    What really needs doing is diagnosing the cause. What are your scheduled tasks? (e.g. use the WP Crontrol plugin, or another like it, to investigate).

    #173744
    Ryan
    Participant

    I appreciate you giving me advice. This was their response

    As you know, WordPress uses a file called wp-cron.php as a virtual cron job, or scheduled task in order to automate different functions. Such can be publishing scheduled posts, checking for plugin or theme updates, sending email notifications, etc. Basically by default the WordPress instance is setup to call wp-cron.php every time someone visits your WordPress website when a scheduled task is present. This should cause no issues with websites that have low traffic, however when more traffic is generated this can cause issues related to the server resources or website performance decrease.

    This is why there are many articles online that suggest how the wp-cron.php functionality can be deactivated. We personally recommend replacing the WordPress cron with a real cronjob. How this can be done for a particular website via the cPanel is explained in the tutorial below:

    https://www.siteground.com/tutorials/wordpress/setup-cron-job.htm

    Generally limiting the execution time in between cron jobs to 30 minutes is considered optimal, so that overuse of the server resources can be avoided. While there are no resource limitations on our Cloud solutions (as you will be the only used on the server and all resources will be allocated for you), please note that the actual performance will depend on the hardware of the workstation. This is why we advice such step to manage the usage of your Cloud server’s resources.

    #173771
    udadmin
    Keymaster

    Basically by default the WordPress instance is setup to call wp-cron.php every time someone visits your WordPress website when a scheduled task is present.

    This is the important sentence, and it’s not clear at the most critical part. What should be said is as follows – I have added the crucial words at the end:

    Basically by default the WordPress instance is setup to call wp-cron.php every time someone visits your WordPress website when a scheduled task is present, and if that scheduled task is now due, according to the time it was scheduled for.

    i.e. If there are no due cron jobs on your site, then wp-cron.php isn’t called, ever. If there are, then it is – but only at the time it is due. Normally, this is a small number. If your site presently has so many scheduled tasks that wp-cron.php is being called very many times each hour, then forcing wp-cron.php to only be called twice per hour won’t reduce the number of scheduled tasks in your WP site (which is the real root of the issue, which should be investigated); it’ll just mean that a lot of scheduled tasks aren’t run until a long time after they were due, and some likely will never be run. What the consequences of that will be depends on what they are.

    Generally limiting the execution time in between cron jobs to 30 minutes is considered optimal

    I think they mean that they consider it optimal from their end. It’s certainly not optimal for the site owner to have his scheduled tasks run late (e.g a task scheduled for 12:35 won’t run until 13:00 – how annoying that will be, depends on what the task is), or not run at all (which is what happens if the backlog is greater than can be serviced with only 2 slots per hour, instead of as many as needed).

    David

    #173816
    Ryan
    Participant

    David, can’t thank you enough for diving into this… it’s extremely helpful as it makes sure my host is honest and suggests changes that are actually helpful and not bandaids that will cause issues down the line. Backups are extremely critical so I don’t want them jeopardizing that.

    That said, if this is moving out of updraft support territory, I totally get it.

    I basically sent your last message verbatim to Siteground, and they came back with this:

    I believe that both your corrections to the statements are correct. Indeed we consider the suggested time in between the executions of the cron jobs best for our shared server instances for example. There is no limit and you can set shorter intervals for the cron jobs. However the platform’s CPU resources would not be able to manage that many PHP processes along with the actual traffic to the website.

    and:

    I am sure that you would understand that there is no server setting we can tweak to avoid the intermittent “HTTP Error 503 – Service unavailable” errors you faced. The possible alternative is an upgrade of the CPU cores for your server. Currently you have 3 RAM units and 1 CPU core. When there are many processes handled simultaneously the memory is exhausted as only one CPU core is handling the processes. It you consider an upgrade this can be easily done via the client’s area > “My Accounts” tab > “Upgrade” button > then use the slider to upgrade the CPU resources. Note that you can also use the “Usage Stats” button to check the recent usage statistics.

    this is the third time they’ve suggested an upgrade to my account, and my account is less than 30 days old… not exactly comforting when they originally told me that the plan i signed up for would be sufficient. siteground seems to get a lot of love around the internet and i’m beginning to question why.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘siteground is recommending 30 min. cron jobs – will this affect updraft?’ is closed to new replies.