Hostingstep is supported by its readers. When you purchase through links on our site, we may earn a commission. Learn More.

How to Fix Cloudways CPU Usage 100%

If you are using Cloudways DigitalOcean, Vultr, or Linode, chances are your server CPUs are hitting 100% more frequently.

When your CPU hits 100%, all the applications hosted on your server will behave slowly, leading to high TTFB and 5xx errors. This guide provides the most logical ways to fix the Cloudways CPU usage hitting 100% based on the inputs from the Cloudways team and my own experience.

How to Fix Cloudways CPU Usage 100%: Quick Solutions

When Cloudways CPU hits 100%, all sites on your server become slow, causing high TTFB and 5xx errors. This typically happens with Digital Ocean, Vultr, or Linode servers. Here are the most effective solutions based on our experience.

1
Optimize Cloudways Cron
According to Cloudways, multiple Crons running simultaneously can cause CPU spikes. Go to your WordPress application → Monitoring → Running Crons and enable Cron only for required applications.
2
Check Server Load
Review your server specifications and delete any unused applications. If you started with a single site but added more over time, your server may be overloaded. Consider moving high-traffic applications to another server or upgrading your plan.
3
Identify Resource-Hungry Plugins
Use Query Monitor plugin to identify CPU-intensive plugins. Check Queries by Component, sort by Time, and disable problematic plugins. Alternatively, use Chrome’s Network tab to find plugins making excessive admin-ajax calls.
4
Clean WordPress Database
Use WP Rocket or the free WP-Optimize plugin to clean up your database. Remove post revisions, transients, and other database bloat that can contribute to high CPU usage.
5
Disable WP-Cron
Add define(‘DISABLE_WP_CRON’, true); to your wp-config.php file, and use Cloudways System Cron instead for better performance.

How to Fix Cloudways 100% CPU Usage?

1. Check If Your Cloudways Sever is Overloaded

The first and foremost way to fix your CPU overload issue is to analyze your server and see if it can handle all your growing traffic.

I’m insisting on this check because no other optimization will help you if the server is overloaded. This overloading naturally happens with most of my Cloudways client sites, as they started with a single site and added additional sites on the same server as time progressed.

The easiest way to reduce 100% CPU usage is to delete unwanted applications. Due to the unlimited site hosting options at Cloudways, most clients add more sites for future needs.

In my case, my 2GB Vultr server is running three idle applications, which I started as a side project. I deleted the applications, and my CPU usage was reduced by over 30%.

If you don’t have any such idle applications, then upgrade to a higher plan with better CPU resources. I also noticed a strange issue of CPU hitting 100% with no traffic spikes in our server. We reached out to the Cloudways team, and they suggested fixing the WordPress Cron.

NEW: Optimize Cloudways Cron

According to the new input from Cloudways, the sudden rise in 100% CPU usage is due to multiple Crons running simultaneously.

Head over to your WordPress application -> Monitoring -> Running Crons to access all the Crons on your application.

If you have multiple applications on a single server, go through all the Crons and enable Cron only for required applications.

2. Move to CPU Free Auto Scalable Hosting

Some WordPress sites are funnily dangerous and can swag any number of CPUs thrown at them. In this case, you require a CPU-free auto-scalable solution.

Cloudways flexible hosting plans are simply VPS, which means they have a fixed number of CPU and RAM. Therefore, Cloudways can’t auto-scale when your server needs additional CPU resources for the time being.

As a result, the server overloads, making all your sites in the Cloudways application load slower. One solution is to move your sites to a CPU-free auto-scalable WordPress hosting plan.

I moved a few sites to Cloudways Autonomous plans and some to Nexcess hosting. My value choice recommendation is Nexcess, as it is auto-scalable with 32 CPU cores and I don’t see the CPU issues popping up again.

Nexcess server with 32 CPU cores

3. Find Scripts That Causes High CPU Usage 

WordPress plugins are the root cause of many issues, including high CPU usage. Two options exist to identify the high CPU-causing WordPress plugins.

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

The Query Monitor plugin helps debug database queries, PHP errors, and more. Activate the plugin to see a Query Monitor Tab at the top of your WordPress admin panel.

Open Query Monitor -> Queries -> Queries by Component. Sort the Time column and disable or remove the plugins that cause huge load time.

5. Remove Unoptimized WordPress plugins using Chrome:

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

Open any page on your site, right-click on Chrome, and select Inspect. 

From there, navigate to the Network tab and look for “/admin-ajax/”. A site using the “Post Views” plugin may send additional PHP requests, which you can remove by identifying and deleting the plugin.

6. Cleanup WordPress Database

The best practice for cleaning 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 performs a detailed cleanup.

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, WP-Cron can slow down your site and cause CPU spikes whenever the WP-Cron job runs on the backend.

Add the following code to your theme’s wp-config.php file. 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.

special case: Cloudways RAM and CPU Usage High with LearnDash

If you are experiencing high RAM and CPU usage on your Cloudways server while using LearnDash, you can do a few things to address the issue. 

First, make sure you are using the latest version of LearnDash. It includes performance improvements that can minimize load time and maximize efficiency.

LMSs like LearnDash require auto-scalable Managed Fastest WordPress hosting services like Kinsta. Shared Web hosting and VPS providers like Cloudways are unsuitable for hosting LMS services due to limited server resources. 

However, you can also try optimizing your server settings by increasing the RAM or CPU cores on Cloudways or implementing a premium caching plugin like WP Rocket. Additionally, Cloudways offers monitoring tools to help you identify and troubleshoot high RAM and CPU usage issues.

Leave a Reply

Your email address will not be published. Required fields are marked *