There few disadvantages of using shared web hosting and one of them is frequent high cPanel CPU usage.
In my first few months of running my websites, I didn’t face any problem. But when I modified and redesigned the look and feel of my websites by using some plugins and external resources.
I observed that my sites were frequently down as monitored by jetpack wordpress plugin.
My wordpress website CPU usage 100% for the majority time and due to this my web hosting company had to limit my resources. On average they used to limit resources 9 – 10 per day. That’s too much.
So, I contacted my web host provider, they told me to get a cloud or VPS hosting to resolve the problem.
I mean what the hell, I need to upgrade my hosting plan for my websites which gets about 10k – 15k traffic per month and even the web disk space usage was less than 50%.
Then I looked for answers on google, web hosting forums, I did some changes by myself, and finally, I saw some good results.
Right now my High cPanel usage has been reduced.
And I’m going to tell the exact ways I have resolved my problem, hope it helps you too.
Let’s get going with my wordpress high CPU usage fix process(majority process also works for custom made websites or hosted on some other cms like Joomla, Drupal etc.)…
What You Will Learn!
- 1 How to reduce high website CPU usage in cpanel
- 1.1 Check the performance of your website
- 1.2 Block spam and bot traffics
- 1.3 Delete Unused Plugins & Themes
- 1.4 Lower the crawl rate of search engine bots
- 1.5 Optimize Images
- 1.6 Set up WordPress Cache Plugin correctly
- 1.7 Configure Clearfy
- 1.8 Disable WordPress Heartbeat API
- 1.9 Optimize your Database
- 1.10 External comment system
- 1.11 Use Content Delivery Networks
- 1.12 Don’t run too many cron jobs
- 1.13 Don’t use too many real-time stats showing plugins
- 1.14 Some common wordpress high bandwidth & CPU usage plugins
- 1.15 Choose a Good Hosting Plan
- 1.16 Update PHP version
- 2 Final thoughts
How to reduce high website CPU usage in cpanel
Check the performance of your website
Run website test on sites like GTmetrix, tools.pingdom.com, and webpagetest.org, see that the stats.
Check your server response time and see first-byte time.
If you found any plugins or external script is taking time to load, fix that. Look for an alternate.
Block spam and bot traffics
Sometimes third-party crawlers and spam referral traffic bots hamper with the site resources. They put the load on the web servers and this also makes CPU usage go high.
These crawlers can be from sites like ahrefs, semrush, twitter, baidu, yandex.ru, yahoo slurp, etc.
Then you’ll have spam and malicious bots like earn-moneyir.info, we-pingair-for-you.info, visitorsjam and spam referral traffic from this bot can have a drastic effect on your site and web server.
Make sure to block them using free CDN like CloudFlare, WordPress plugins like Wordfrence and mainly via the .htaccess file.
Sore resources for further clarification:
Delete Unused Plugins & Themes
If you’re not using any deactivated plugins or even themes make sure you need them. You can always keep the settings saved somewhere else and install them later.
Why should you delete unused plugins and themes?
Because they take disk space and leaves their settings and cached file, which in simpler term is extra unnecessary coding in your website.
This bad for your website loading speed as these files will also have to load while someone is trying to visit your website. And due to this, it puts a load on CPU.
Another Tip: I learn from one website it is good practice to disable some unnecessary plugin features that we don’t need.
Lower the crawl rate of search engine bots
Search engine crawlers like Googlebot, bing bot, yahoo slurp, Yandex Bot, Baiduspider etc., put the load on the server each time they come to our site to crawl new information.
So, if these crawlers come to visit your site often then this could cause resource depletion and if your CPU usage gets high then your website will be down.
And it will send bad metrics to those search engine crawlers and they may demote your website’s ranking.
Robots.txt crawl delay
Set a crawl rate limit in your website’s robots.txt by adding the following code:
User-agent: * Crawl-delay: 30
Optimizing images play a vital role in website loading. Use compressed images in .jpg and .jpeg format.
Also, you need to resize your image, according to me I will say that ideal image size should be below 600 pixels.
Set up WordPress Cache Plugin correctly
WordPress plugins to reduce CPU usage, use and configure correctly cache plugins like W3 Total Cache, WP Fastest Cache, WP Rocket. These plugins which help you to reduce server load.
This is a very handy plugin, there’s nothing complex in setting up this plugin. This is a multi-feature WordPress optimization plugin and disables ultimate tweaker.
OPTIMIZE SEO AND SPEED OF YOUR WEBSITE IN 5 MINUTES
- Clear website code from trash;
- Eliminate the WordPress vulnerabilities;
- Speed up search engine indexing;
- Fix another plugin’s bugs;
- Make your WordPress easier, more convenient and faster.
Setting up this plugin will help to optimize wordpress further by disabling the following things:
- Disable Rest API
- Remove jQuery Migrate
- Remove DNS-prefetch
- Minify Html
- WordPress Sanitization
Disable WordPress Heartbeat API
Clearfy can also help you to optimize wordpress heartbeat API to lower the number of execution by wordpress. This API run every 10 – 15 seconds allowing near-real-time frontend updates.
This, in turn, depletes resource and puts a load on the web server.
Using cleary you:
Disable WordPress Heartbeat API — completely disables the Heartbeat API WordPress function.
Limit WordPress Heartbeat API — limit the frequency of Heartbeat API requests.
Read more about heartbeat API click here
Optimize your Database
Optimize and repair your wp database once in a weekly to keep things keep going nicely.
There are two ways to do this,
1.Do it manually by logging to your cPanel >> MySql Database >> Select your website database >> *Click on repair database. *Make sure to take a backup before.
2.Using Optimize database plugin. It has a one-click wp database optimize feature.
External comment system
An external commenting system like Disqus, when they load they make requests to the server and this can increase ram and CPU usage significantly.
Use Content Delivery Networks
Using CDNs like Cloudflare, Amazon AWS, Google cloud etc., they can handle the spam & malicious bot traffic and will also help your website by taking some load of your web hosting service provider.
If you think CDN can do the required job, you go with premium cloud hosting.
Don’t run too many cron jobs
Cron Jobs take resources from the web server itself, so if you run too many cron jobs, then you’ll be short on server resources.
If you’re on an unlimited hosting plan then you may go for it or else use some third party cron service like easycron to schedule and run cron jobs.
Learn more about cron jobs here.
Don’t use too many real-time stats showing plugins
Real-time stats showing plugins like Google Analytics, JetPack etc., these plugins send a request to your server to fetch real-time stats for you.
They put a good amount of load on the server and increase ram usage.
Using less is a good option here.
Some common wordpress high bandwidth & CPU usage plugins
- Contact Form 7
- Disqus Comment System
- Yet Another Related Post Plugin
- Yuzo Related Posts
- Broken link checker
Use a lighter version of plugins. If one plugin is increasing CPU usage then look for an alternative.
Use Query Monitor see which plugin is causing the issue, disable it and look for an alternative plugin or lighter version of it if available.
Choose a Good Hosting Plan
Web hosting plan plays the most vital role in this case, you can’t have unlimited things in the limited hosting package.
A hosting plan that gives you 20 GB of disk space, unlimited bandwidth and at least 2 GB of ram. This will significantly help you in reducing CPU usage.
Update PHP version
It is seen that update your server PHP version to the latest can drastically help you run wordpress in the most efficient way. Use PHP 7.0 and up. This will help to reduce php CPU usage.
The wordpress high CPU usage fix tips that I shared today, can help you “Reduce High cPanel CPU Usage Shared Hosting”. Just try each of the above methods and see which one works for you.
Get more stuff like this
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Thank you for subscribing.
Something went wrong.