How to make WordPress blog faster and minimize CPU Usage

In this article, I will share my personal experience regarding this blog performance and nightmares of disabling website everyday because of CPU Utilization. I tried all my best however I was unable to figure out the cause of high CPU Usage by wordPress. I tried many articles on Google and at last I found some pointers and able to escape from this problem.

This article is specific to my problem only, However I am sure it will help many others also.

I started with ways, which will less impact my blog and will take less time.

1. Disable WordPress Cron Job

This was my first step, disabling cron Job. In most of cases we are not using this feature. Mostly it is used when you schedule some article to publish on some day or time. To disable it, Open “wp-config.php” file and add below line at top of page.

define(“˜DISABLE_WP_CRON’, true);

What if I need this cron job ?

You can easily create a cron Job anytime, by following below process.
a. Log into your cPanel.
b. In the Advanced section, click Cron jobs.
c. Under Add New Cron Job, select the time interval. It is recommended not to add time interval less than 15 minutes.
d. Set the cron command to the following, replacing yourwebsite.com with your actual domain name:

wget -q -O – http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

The above command tells the Linux server to run wp-cron via wget, which will trigger the wp-cron.php script to do it’s job on your schedule instead of on each page view. This will lessen the amount of processes on the server.

e. Click Add New Cron Job to set the cron.

2. Disable Plugins

Now, Here comes actual reason for WordPress blog high CPU usage. I had many plugins and started to disable one by one. Continue reading “How to make WordPress blog faster and minimize CPU Usage”

Create Cron job to run PHP Script in Cpanel

Author posted by Jitendra on Posted on under category Categories Linux and tagged as Tags , , with 1 Comment on Create Cron job to run PHP Script in Cpanel

Hi All,

Today i just want to share that how to create  a cron job in Cpanel to run the PHP script.

I hope everyone knows that what is Cron job : it is the task schedule in Linux which will run on predefined time interval. its same concept like schedule tasks in Windows OS.

To create the cron job, open the Cpanel and select “cron jobs”.

Select Cron job in Cpanel

You can see that in drop down list there are lots of common schedules of crone job, you can select it, or create your own schedules.

Common settings in Cpanel

In Command text box, write the PHP program path and file to be executed like:

/usr/local/bin/php -q /home/<username>/script.php


to find the path to php,
log on to the server with SSH, then run this command:
“”””””””””””-
which php
or
whereis php
“”””””””””””””-
This will give you the path to the php executable, probably:
/usr/local/bin/php