How to Fix Cloudways CPU Usage 100%

A step-by-step guide on how to fix Cloudways CPU Usage 100% and multiple solutions to reduce CPU usage.

Cloudways is one of the most popular managed Cloud hosting providers powered by five different cloud providers. The Cloudways plans come with fixed CPU cores based on the plan.

Due to multiple reasons, the Cloudways server's CPU usage will be 100%, causing a slowness to the existing sites.

This guide will showcase multiple ways to fix a high Cloudways CPU Usage 100%.

How to Fix Cloudways CPU Usage 100%

1. Fix the Server Overload

The first and foremost step is to analyze the traffic range of your existing sites and then move your high-traffic sites to a new server.

I'm insisting on this solution because even if you do hundreds of optimization, the CPU usage won't reduce if your site have upward traffic. It's a server overload issue.

Image Credits – Cloudflare Forum

Solution: Do an honest assessment of your server specification and understand if the server can handle the growing traffic of your sites.

If you believe traffic is not an issue, follow the below steps.

2. Move to CPU Free Auto Scalable Hosting

The Cloudways servers are VPS hosting with fixed server resources. At times, a site may require additional server resources to handle traffic, but Cloudways can't auto-scale due to its VPS architecture.

In such cases, CPU-free auto-scalable WordPress hosting is recommended. Unfortunately, Cloudways doesn't have such a plan, and my recommended options are Templ ($15/month), Nexcess ($19/month), and Rocket ($30/month).

Templ tech stacks is powered by Google (Cloud + CDN + DNS) and one can avail a free page speed optimization while moving your sites to them.

Each recommended host is field-tested and rated as “Fastest WordPress Hosting” based on 12-month data.

3. Upgrade to a higher Cloudways Plan

Another quick way to fix the Cloudways CPU usage 100% is to upgrade to a higher Cloudways plan. You can choose between Digital Ocean or Vultr and re-check the CPU usage.

If there are no issues with your WordPress site setup, this upgrade will fix the high CPU usage. If you are still experimenting with the case, the below recommendations should fix the problem.

4. Remove CPU-Intensive WordPress Plugins

The WordPress plugins are the root cause of many WordPress issues, including high CPU usage.

There are two options to identify the high CPU-causing WordPress plugins.

  • First, use the query monitor plugin.
  • Second, using Chrome browser.

Query Monitor plugin helps to debug database queries, PHP errors, etc. Install and activate the plugin to see a Query Monitor Tab at the bottom of your WordPress admin panel.

Open Query Monitor -> Queries -> Queries by Component. Sort the Time column and disable or remove the plugins, which takes time.

Remove Unoptimized WordPress plugins using Chrome:

The unoptimized plugins send a non-cacheable request processed by PHP. The more uncacheable requests, the CPU usage will be higher.

To find if any of your plugins are causing this issue, open any page on your site, right-click on Chrome, and open Inspect. Head to the Network tab and check for /admin-ajax/.

Here is one site that uses the “Post Views” plugin and sends additional PHP requests. You can find and remove such plugins.

5. Use Cloudflare CDN to Offload Server Resources

Cloudflare CDN is an excellent example of the term “great things come for free.” Configure your site with Cloudflare free plan and offload your website content to Cloudflare's 200+ global data centers.

Through this process, only the uncached pages will be delivered through your Cloudways servers, while 99.9% of requests will be processed through Cloudflare.

You can offload static resources like CSS, JS, and images on Cloudflare or the entire HTML pages. I recommend the second option for the best results.

This step significantly reduces the server CPU usage. Cloudways offers a Cloudflare Enterprise add-on for $4.99/month which can be activated with a few clicks.

6. Cleanup WordPress Database

The best practice to clean up a WordPress database is using WP Rocket or WP-Optimize plugin.

At WP Rocket, Click the “Database” Tab and find the following cleanup options:

  • Post Cleanup
  • Comments Cleanup
  • Transients Cleanup
  • Database Cleanup

Read instructions on each cleanup process and proceed accordingly.

Alternatively, WP-Optimize is a free database optimization plugin that does a detailed cleanup. Whatever plugin you're trying, don't forget to back up your site before doing this step.

7. Disable WP Cron

The Cron Jobs perform the scheduled task on your site during a fixed date or time.

WP-Cron is responsible for performing WordPress Cron jobs. However, based on your site traffic, the WP-Cron makes your site slow down and causes CPU spikes whenever the WP-Cron job runs on the backend.

Add the following code to your theme's wp-config.php file. Just add the code above the line that says “/* That's all, stop editing! Happy publishing. */”

define('DISABLE_WP_CRON', true);

Once disabled, you can use the Cloudways System Cron instead of WordPress Cron for faster performance.

8. Optimize Images

To reduce the Cloudways CPU usage from 100%, it's essential to compress and optimize the site's image for quicker delivery.

The size and quality of the image are the major factors that cause high load time, eventually landing in high CPU usage.

ShortPixel is the best free image optimization plugin to compress the size and quality of the image. Get started with the default settings and move to the “Bulk ShortPixel” option to optimize existing images.

Conclusion

There are many unique techniques discussed above to reduce Cloudways high CPU usage from 100%. There are even more lists of CPU optimization techniques available, though they're not going to be super helpful to the sites hosted on Cloudways. The above practices will be better for fixing the CPU issue.

Share it!