Namecheap
+ Post New Thread
Results 1 to 2 of 2

Thread: wp-cron.php causing high load on server, long running script

  1. #1
    Fli
    Fli is online now
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,610

    wp-cron.php causing high load on server, long running script

    make money with your web site
    WP-CRON.php is making sure emails are sent out, scheduled posts are published, updates are checked etc.

    This script can take a long time on big sites so this is my treatment:

    I added following line into wp-config.php (below "<?php")
    Code:
    define('WP_CRON_LOCK_TIMEOUT', 900);
    in aim to do not allow wp-cron to run more frequently than each 900 seconds

    I setup cronjob to kill wp-cron.php process every midnight so there is no indefinatelly running wp-crons

    Code:
    52 23 * * * root pkill -f "wp-cron.php"
    this line i added into file /etc/cron.d/myjobs which have 0600 permissions and root:root

    ---
    It is also possible to disable wp-cron from within wp-config.php by adding:
    Code:
    define('DISABLE_WP_CRON', true);
    and then setting up cronjob to run wp-cron manually:
    Code:
    wget -q -O – http://yourdomain.tld/wp-cron.php?doing_wp_cron >/dev/null 2>&1

  2. #2
    Junior Member kumkum's Avatar
    Join Date
    Apr 2018
    Posts
    29


    Is this useful / helpfull? Yes | No
    If wp-cron consuming too much resources then we can disable it in Wordpress.
    For that you have to add below line in wp-config.php file:
    Define(‘ DISABLE_WP_CRON’ , true);
    And now save the file.

    If you want to run any cron then you can manually create it in cpanel;
    Login to cpanel >> Cron jobs

    if you want to know more about disable wp-cron.php file then you can check.

+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 04-28-2017, 08:49 AM
  2. Replies: 0
    Last Post: 03-14-2017, 10:04 PM
  3. Replies: 0
    Last Post: 11-16-2014, 07:42 PM
  4. Replies: 0
    Last Post: 11-15-2014, 07:36 PM
  5. Replies: 0
    Last Post: 08-30-2014, 12:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam