CPU Usage- What is it?
The usage that a system’s central processing unit incurs is referred to as CPU usage. A shared server is actually a dedicated or virtual machine, which is divided on the basis of bandwidth and disk space. When this shared server exceeds the CPU usage parameter, the web host will suspend that account temporarily. Hence, if you have a wordpress blog, ensure keeping CPU usage to its minimum.
How to lower CPU Usage?
CPU usage usually depends on the amount of request that your server receives. Besides, it may also depend on the number of people accessing your site/blog at the same time. Whatever the reason may be; your objective is to reduce CPU usage.
Step 1. Remove Unnecessary Plugins
This might be first point you would ever see in WordPress CPU optimization. Plugins are the most resource eating materials when it comes to WordPress. Hosting companies usually suggest maximum 3 or 4 plugins but in the live case, it isn’t possible unless we run a story narration blog.
Since we are solely depending on plugins to automate certain processes, it’s really hard to find the plugins which should be avoided.
In this scenario, we must compromise on visual effects and should focus on blog optimisation. ie., concentrate on necessary show ups and avoid eye-catching sliders, related posts plugins etc.
In order to find the most resource consuming plugin, you can try P3 Profiler (Which is again a plugin :P). It accurately measures your server resource from head to toe from plugins side and show the results in in the form of easily understandable charts.
Try to avoid use of badly coded related post plugins. Related post plugins have many issues. Even good plugins in this category like ‘Yet Another Related Posts Plugin (YARPP)’ has many issues.
Many web hosts have banned its use in shared hosting plans. It resulted in high load of CPU and increased query time. Think before using them. I suggest you to use nRelate Related Posts plugin instead of YARPP.
Step 2. Minimize the number of WP Crons:
The WordPress Cron job is a resource intensive task that runs every single time yourWordPress is accessed.The best way to optimize the efficiency of your WordPress cron jobs is to disable WP-cron and set up a normal cron job through cPanel which will run every 12 hour or once per day.
You can disable WP-cron by modifying the wp-config.php (located in the folder where WordPress is installed). Open the wp-config.php file, add a new line after <?php, then add the following code on the new line:
Step 3. Using Cache Plugins
W3 Total cache (W3TC) and WP Super Cache are the most effective cache plugins I’ve ever came across. Though some people suggest WPSC, I should recommend you to install W3TC as it’s loaded with advanced options like minification, database cache, page cache, cache purging, CDN optimization, CloudFlare integration etc.
After installing either of these plugin (Preferably, W3TC), configure every options from its dashboard. It can also be used to flush your temporary DNS cache which is very helpful wherein DNS propagation period.
Step 4. Using CloudFlare
CloudFlare is a free blog optimization service which can also be considered as a basic CDN service. Don’t expect too much from their CDN as it accelerates your blog without any bucks. However, you can significantly improve your page loading speed and CPU load.
It works as an intermediate between the blog and the server. Whenever user requests a page, CloudFlare provides the page without letting the blog from accessing the server contact. It automatically catches your pages from the server side and stores in its own large data servers.