I think it’s safe to say my blog is officially going through growing pains! Earlier this morning I had a chat session with Hostgator because I kept receiving database errors when I was checking on my site. I felt like I was having Déjà vu since it was only a couple weeks ago that I had slow WordPress database issues.
I never expected the amount of traffic this blog receives to grow so rapidly, last month there were 10 times the number of visits I received back in January of this year.
Ironically Hostgator’s support department found that the reason my server was so slow was due to one of the WordPress scripts on my site, wp-cron.php. Below is an excerpt of the email I received from HostGator.
Subject: Ticket [QCQ-15945XXX]: TOS/CPU Reply-To: 15945XXX@tickets.hostgator.com Hello, Unfortunately, we were forced to suspend the script "/home/<username>/public_html/samkear.com/wp-cron.php" as it was causing a high load on the server, and due to this affecting all of the other accounts on the system, we were forced to take immediate action for the health of the server. This particular script is used for certain wordpress tasks, such as trackbacks, link checks, and autoposting plug-ins. If you have a large volume of articles, we recommend that you disable this, or disable this on any particularly popular popular articles that you may have. Please let us know how you would like to proceed. Best Regards, SteveC Linux Systems Administrator HostGator.com LLC http://support.hostgator.com
In the message they said they were forced to suspend the script. As you can see below HostGator removed all permissions on the wp-cron.php file preventing all access to it.
I did some research on wp-cron and apparently the php script is called on every single page load! To me this seems to be out right ridiculous, why would WordPress implement such a sloppy function call?
HostGator’s suggestion to disable wp-cron all together was starting to sound pretty good.
I stumpled on a post on buildyourblog.net that was made just a few days ago that explains how to disable wp-cron.
Following Graham’s instructions I edited wp-config.php using the editor in cpanel to disable wp-cron. I then setup a cron job to run wp-cron.php twice a day. I let host gator know of the changes I implemented so hopefully they will restore permissions to the file soon.
This change should make a big impact on the overall performance of the site since wp-cron won’t have to run hundreds of times daily. The WordPress authors really need to look into changing the cron functionality in WordPress.