How To Reduce CPU Usage On HostGator (Bandwidth Limits/Throttling Which Cause 503 Service Unavailable Errors)

Are you exceeding your CPU usage on HostGator?

Excessive CPU usage on HostGator happens when your hosting plan doesn’t have enough server resources to accommodate your website’s resource consumption. Reducing CPU usage usually requires removing resource hungry plugins, offloading resources to CDNs, and fixing items in GTmetrix. Use AWstats (built-in to HostGator) or Query Monitor to find the source.

Just a heads up, HostGator is terrible. They restrict CPU usage and have slow server response times. Just look at the Facebook polls or read some conversations in the WordPress Hosting Facebook Group. They’re owned by EIG and have gone completely downhill. If you want to stop exceeding bandwidth limits, this guide will help, but I would switch to SiteGround or Cloudways. I use SiteGround (you can view my GTmetrix/Pingdom report with <1s load times).

Reduce-CPU-Usage-HostGator

 

1. Upgrade To PHP 7.2

Upgrading to PHP 7.1 or 7.2 can make your site significantly faster, while reducing CPU usage. This is especially true if you haven’t upgraded PHP versions for awhile (or have never done it).

Step 1: In your HostGator cPanel, select the PHP Selector.

HostGator-PHP-Selector

Step 2: Select a newer PHP version (the higher, the faster).

HostGator PHP Upgrade

Step 3: Check your website for errors. If you see errors, chances are you’re running plugins that aren’t compatible with the newer PHP version. In this case, run the PHP Compatibility Checker plugin to see which plugins are incompatible. You either need to delete these plugins (and replace them with plugins that are maintained better) or revert to an earlier PHP version.

PHP-Compatibility-Checker

Step 5: Enjoy your website which should be much faster.

WordPress PHP Benchmarks

 

2. Offload Resources To Cloudflare CDN

Offloading heavy files to Cloudflare’s 200+ data centers greatly reduces the load on your own server. Cloudflare’s CDN is free and quite simple to setup, just follow these instructions below.

Step 1: Sign up for Cloudflare (free plan).

Step 2: Run the scan and you will eventually come to a page with 2 nameservers.

Cloudflare-Nameservers

Step 3: Login to your HostGator account > Domains > Gear Option > Change Nameservers.

Step 4: Replace HostGator’s nameservers with the ones Cloudflare’s provided you.

HostGator Nameservers

 

3. Control WordPress Heartbeat API

The WordPress Heartbeat API runs in the background of your admin panel automatically. It shows real-time plugin notifications, when other users are editing a post, and other resource-hungry tasks. This generates a request every 15-30 seconds, so it’s best to disable it to save on bandwidth. Install the Heartbeat Control plugin and set it to 60s, or better, disable it entirely.

Some cache plugins like WP Rocket have an option for heartbeat control.

WP-Rocket-Heartbeat-Control

 

4. Clean Your Database

A bloated database can slow down your website and also consume bandwidth. Install the WP-Optimize plugin and schedule it to run every 1-2 weeks, keeping your database nice and clean.

WP-Optimize Clean Database

 

5. Use A Great Cache Plugin

All 3 are super important:

  • If you’re using a cache plugin
  • Which cache plugin you’re using
  • Whether the settings are configured optimally

If you can afford $49/year, WP Rocket was rated the #1 cache plugin in multiple Facebook polls. That’s because it comes with many features most cache plugins don’t (see below). Otherwise, you would need to install about 6 extra plugins to get these features, when WP Rocket has them all built-in, reducing the number of plugins on your site. If you use another cache plugin, you’ll want to research which features that specific cache plugin comes with, then install these plugins if it doesn’t support them.

2016 best cache plugin poll

2019 cache plugin poll

Swift vs WP Rocket

2016 cache plugin poll

Best cache plugins 2018 poll

wp rocket vs w3 totla cache

WP Rocket has more features than other cache plugins:

WP-Rocket-Features

If you can’t afford WP Rocket, I recommend either Swift Performance or WP Fastest Cache.

 

6. Configure Optimal Cache Plugin Settings

I wrote tutorials for the most popular cache plugins. It is very important you configure these optimally… even 1 simple setting (eg. object cache) can greatly affect load times.

 

7. Eliminate High CPU Plugins

Too many plugins (or 1 single high CPU plugin) can skyrocket bandwidth usage. Common high CPU plugins include social sharing, statistic, backup, live chat, page builders, and related post plugins. You should either delete them, replace them with lightweight plugins (you may need to do research), or you will need a hosting plan with enough server resources to accommodate them. Thank you Ivica from the WordPress Speed Up Facebook Group for starting this list.

  1. AddThis
  2. AdSense Click Fraud Monitoring
  3. All-In-One Event Calendar
  4. Backup Buddy
  5. Beaver Builder
  6. Better WordPress Google XML Sitemaps
  7. Broken Link Checker
  8. Constant Contact for WordPress
  9. Contact Form 7
  10. Contextual Related Posts
  11. Digi Auto Links
  12. Disqus Comment System
  13. Divi Builder
  14. Elementor
  15. View Full List Of 65 Slow Plugins

You can also use the GTmetrix Waterfall tab (or Query Monitor) to find your slowest plugins:

Slow WordPress Plugin

If you plan on using resource-hungry plugins, you will inevitably need to upgrade your HostGator plan (their business plan is better, their VPS is even better but if you’re spending that kind of money, you’ll be better off with SiteGround, Cloudways, Kinsta, or WP Engine).

 

8. Eliminate External Resources

External resources are almost inevitable. Embedding a YouTube video, a tweet, using a social plugin that connects to Facebook, Google Fonts, running AdSense… these will generate extra requests and will likely appear in your GTmetrix / Pingdom reports. Here are some quick tips:

Prefetch DNS Requests
In cases where you must use external resources, you can prefetch them. This helps browsers anticipate them and loads them faster. Luke created a nice list of common domains to prefetch including Google Maps, Fonts, Analytics, YouTube (when embedding videos), Disqus and more.

Prefetch-DNS-Requests-List

WP Rocket has an option for prefetching:

Prefetch-DNS-Requests

Otherwise you can add it to your header:

<link rel=”dns-prefetch” href=”//youtube.com”>
<link rel=”dns-prefetch” href=”//maps.googleapis.com”>
<link rel=”dns-prefetch” href=”//fonts.googleapis.com”>

 

9. Serve Scaled Images

If you see serve scaled image errors in GTmetrix, it means you need to resize large images. GTmetrix tells you which images need to be resized and their correct dimensions, but it only shows unoptimized images for the single page you test. If you have common image dimensions (sliders, widgets, carousel, fullwidth blog images) you can create a cheat sheet with all their dimensions. Then crop/resize images before uploading them. This can save you time, and CPU.

Serve Scaled Images

 

10. Losslessly Compress Images

This means you need to lossless compress them (ShortPixel is great). Set the compression level, then optimize a couple images in your media library to make sure you’re happy with the quality. If yes, you can bulk optimize images, and automatically compress images upon upload.

optimize-images-gtmetrix

 

11. Block Spam Bots

These are way more common than you think.

compute.amazonaws.com was hitting my site every 3 seconds and draining CPU on literally nothing. If you haven’t checked to see which bots are hitting your site, I would 100% do this.

Install Wordfence and use their live traffic report to see all bots hitting your site in real-time.

Live-Traffic-Report-Wordfence

Write down all hostnames that look suspicious and hit your site frequently. Google them, and see if other people are reporting them as spam. If yes, go to Wordfence’s Blocking settings (you can also use Cloudflare firewall rules) and block the spam bots here. Be sure to user an asterisk to block all variations of that bot. Check your blocking log and watch the bots get blocked. If your site was getting hit frequently by spam bots, this can save a LOT of bandwidth.

Wordfence-Blocking-Rule

Wordfence also has rating limiting settings. This limits/blocks crawlers (and humans) from making excessive requests, blocks fake Google crawlers, and improves security on 404 pages. The settings below are the same ones recommended by Wordfence on their rate limiting page.

Wordfence-Rate-Limiting

Another alternative, is to simply install the Blackhole For Bad Bots plugin.

Blackhole for Bad Bots

 

Hotlink protection prevents people from copying your images and pasting them on their website, which consumes bandwidth since you are still hosting those images. This usually only happens if your website has high quality images (eg. photography). Follow these instructions:

  1. Login to cPanel and click HotLink Protection.
  2. Make sure the domain name you wish to protect is in the box called “URLs to allow access”.
  3. In the box called “Block direct access for these extensions”, provide the extensions for which you would like to block.
  4. We suggest you check the box for “Allow direct requests”.
  5. Skip the “Redirect request to this URL” box and hit Submit.

Cloudflare also has an option for hotlink protection in the scrape shield settings:

Cloudflare Hotlink Protection

 

13. Check AWstats To Find Source Of High CPU

AWstats is built-in to the statistics section of your HostGator cPanel and can help you identify the source of high CPU. It tells you exactly how much bandwidth is consumed by bots, images, and other elements. Remember, you can block spam bots with Wordfence or the Blackhole For Bad Bots plugin, and you can optimize your images using tools like GTmetrix and ShortPixel.

Robots-Spiders-Bandwidth

 

14. Check Server Response Times

Slow server response times are never good for CPU, load times, or anything. Run your site Google PageSpeed Insights and check if improve server response time appears in your report.

CPU and server response times go hand-in-hand. If you went through my tutorial and you still have high CPU usage on HostGator, you probably know what the problem is – it’s HostGator.

Reduce Server Response Time

 

15. Get Better Hosting

HostGator sucks.

They were rated very poorly in Facebook polls and people constantly complain about their slow server response times, bandwidth limits, and of course their bad support and uptimes.

Hosting recommendations are usually garbage.

Join the WordPress Hosting Facebook Group to get unbiased feedback. Most members (myself too) swear by Cloudways WordPress Hosting. Specifically DigitalOcean / Vultr High Frequency.

Yes, it’s a little more expensive at $10-$13/month, but we’re talking about speed here – not being cheap. With Cloudways, you have a choice of using DigitalOcean, Vultr High Frequency, Google Cloud, AWS, or Linode. These are worlds faster than shared hosting and can handle resource-intensive tasks much better (Elementor, Beaver, Divi, WooCommerce, AdSense, etc).

Cloudways makes it easy to test them out and see the difference in your load times: they do free migrations, monthly pricing, a Migrator plugin, and a promo code to save money: OMM25

Here’s what happened when I moved:

SiteGround vs Cloudways

GTmetrix tests are always different, but even posts with a huge page 2.70MB page size and 96 requests can often load in under 2s. I’ll also take a 148ms time to first byte any day of the week. That post has 70+ images, 480 comments (showing Gravatars), Font Awesome, and Elementor.

OMM-TTFB

The evidence is there:

Cloudways Response TimesCloudways-Migration-Result
Cloudways Google PageSpeed
WP Engine To Cloudways
DigitalOcean Pingdom Report
Hosting-Recommendation
Moving-From-WPX
SiteGround-Alternatives
Preferred-Web-Hosting
UntitledWPEngine-To-Cloudways
Godaddy DigitalOcean Migration
Cloudways Pingdom Load Times
Cloudways Pingdom Report
Elementor-Hosting
Web-Hosting-France
SiteGround-Alternative
VPS-Cloud-Hosting

 
This was a simple Pingdom test to measure load times of 16 WordPress hosts. I signed up for popular hosting companies then installed the same Astra Starter Site on each of them while measuring load times in Pingdom for 1 week at 30 minute check intervals. Some domains are still live (cwdoserver.com is hosted on a $10/month Cloudways DO plan and stgrndserver.com is hosted on SiteGround GrowBig). I cancelled most of them because it was getting expensive. Even when browsing through their pages or running your own tests, you can see the difference.

WordPress-Hosting-2020-Pingdom-Test

Hosting Companies You Should Avoid

  • SiteGround – they have gone completely downhill in recent years.
  • Bluehost – slow servers, owned by EIG, bad support, rated poorly in FB Groups.
  • HostGator – also owned by EIG with slow servers, bad support, CPU limit issues.
  • GoDaddy – top malware hosting network worldwide, rated poorly in FB groups.
  • Hostinger – they write fake reviews and vote for themselves in Facebook polls.
  • WP Engine – also not what it used to be, expensive and not even fast anymore.
  • *A2 Hosting – if you can’t afford Cloudways, A2 is still fast and uses LiteSpeed.

I use Cloudways because:

  • Even posts with a 2.70MB page size can load in under 2s
  • DigitalOcean and Vultr HF are miles faster than shared hosting.
  • It’s $10-$13/month (no yearly contracts or high renewal prices).
  • Varnish, Redis, and memcached are all built-in for higher performance.
  • You get to pick from DigitalOcean, Vultr HF, Linode, AWS, Google Cloud.
  • 4.8/5 star TrustPilot rating and highly recommended in Facebook Groups.
  • They have 25+ data centers between all their cloud hosting providers.
  • No CPU issues like on SiteGround, Bluehost, and other shared hosting.
  • SSL, staging, and backups are all very easy in the Cloudways dashboard.
  • Support used to be average, but is now really good as reflected on TrustPilot.
  • They offer a free migration but their Migrator plugin will also do the trick.
  • Adding a server, migrating your site, and the dashboard is actually very easy.
  • Mustasaam (their community manager) gave me peace of mind when moving.
  • Only complaint is they need to add LiteSpeed servers to their list of providers.

Affiliate Disclaimer – if you sign up for Cloudways using my affiliate link, I would seriously appreciate it. I don’t recommend bad hosting like many other affiliates. I also donate quite a bit to charity ($6,000 to GoFundMe so far) and your support would really help. I try to base my reviews not only from my experience, but real evidence from the overwhelming feedback in numerous Facebook Groups. It would mean a lot.

Just do your research and look at this Facebook thread.
 

Frequently Asked Questions

✅ What causes high CPU?

High CPU is usually caused by a slow server, resource-hungry plugins, an increase in website traffic, not using a CDN, and websites that aren't optimized for speed.

✅ How do you reduce CPU?

Upgrade to the highest available PHP version in your HostGator cPanel, configure a cache plugin (I recommend WP Rocket), setup Cloudflare's free CDN, install the Heartbeat Control plugin, clean your database with WP-Optimize, and consolidate your plugins.

✅ What are HostGator's CPU limits?

On HostGator's CPU Resource page, they save they have a 25% CPU usage limit, and that you may exceed this limit for no longer than 90 seconds.

✅ Is HostGator the problem?

HostGator was rated poorly in Facebook polls and is known for having slow servers if you do your research in Facebook Groups. Look at people who migrated from HostGator to other hosts and you will see there are definitely better options.

✅ Will switching hosts fix the CPU issue?

Every host has CPU limits. You need to learn how much CPU your potentially new hosting plan comes with and compare it to your current HostGator plan. If it has more more, it should fix the issue.

Hope this helped.

Cheers,
Tom

Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments