How to Fix Siteground’s CPU Limits
SiteGround CPU limits should not be a major concern for you. Every hosting company sets limits to the amount of resources you can have per plan.
In this article we will discuss the many steps you can take to reduce your CPU limits. Most of the steps to take to reduce CPU limits will also not cost you anything to implement.
The corresponding images shows you the different resources than you can reach per plan per month. Keep in mind, the diagram does not cover the SiteGround Cloud hosting solution where you can scale your resources on demand and those obviously will have a Higher CPU limit.
1. Upgrading your Hosting Plan
Upgrading your hosting plan, should not be the first step you take. Sooner or later as your site grows and becomes popular, you will need to optimize it for the best results. You should start with the below steps and then finally as a last resort, you should upgrade your hosting plan if you need to address your CPU limits using SiteGround for hosting.
2. Reduce the time frequency of Cronjobs or disable them
The cron command-line utility, also known as cron job, is a job scheduler that runs periodically at fixed times, dates, or intervals. You can think of a cronjob as a task that is scheduled to run at defined period in time.
In SiteGround, cronjobs are set to run of on every site visit. You should change that setting for it to run every 10 minutes.
As a matter of fact you can set the interval for any specific cronjob to any amount of time of your choosing. You just need to understand the purpose of the cronjob and be comfortable with the time interval for it to run.
In Siteground under Websites option, select Site Tools and then to the left Under “DEVS” you will see an area for CronJobs. From there, select each Cronjob in the list and set it to a new time interval.
3. Upgrade to the Latest version of PHP.
With each new PHP version, not only increases the performance of how fast your site loads, but it also decreases the resources needed to run your site.
You should always use the latest version of PHP
In Siteground, under Websites option, select Site Tools and then to the left Under “DEVS ” you will see an area for PHP Manager, Under your PHP Manager area, you will learn what version of PHP you are running , in addition you can change the version and upgrade to Ultra-fast PHP. As of writing this article, the latest version of PHP is 7.4.28
4. Optimize WordPress Heartbeat
The WordPress Heartbeat API checks your post edit pages every 15 seconds and your dashboard and front end every 60 seconds, even in the absence of scheduled tasks. This can generate high CPU usage if you leave browser tabs in which you’re logged to WordPress opened for a longer period of time. You can modify these settings to reduce load.
How to Limit WordPress Heartbeat
To limit the functionality of the WordPress Heartbeat plugin, you can adjust the execution frequency for individual locations. This can be done using the SiteGround Optimizer Environment tab for each of the three locations. By saving the changes, you override the default Heartbeat execution frequency with the value specified in the Frequency slider option.Alternatively, you can utilize the menu to select the option Disable for the selected location, which will disable the Heartbeat feature for that place.
With the new settings in the SiteGround Optimizer, you can either totally disable the Heartbeat API if no functionality requires it, or configure it to run at significantly larger intervals. By default, Siteground disables it on your admin and front end pages, leaving it to run every 180 seconds on post edit pages.
5. Make use of caching
One of the nice things about SiteGround is that it offers caching as part of your hosting plan.You do not need additional plugins to turn it on.
Caching is a mechanism to improve the performance of any type of application. Technically, caching is the process of storing and accessing data from a cache. A cache is a software or hardware component aimed at storing data so that future requests for the same data can be served faster.
Caching takes off a significant amount of load of your server which in tern saves you CPU utilization.
In addition SiteGround offers its users, 3 types of caching which are static, dynamic & memcached. You should take advantage of all of them. Using the SG Optimizer settings, they are to easy to configure. All you have to do is turn on the switch.
6. Leverage the Cloudfare CDN
Cloudflare does not require an extra CDN subdomain or hostname, and you do not need to change your URLs.
Cloudflare makes customer websites faster by storing a copy of the website’s content on the servers of our globally distributed data centers.
Siteground has a partnership with Cloudfare and you will not need to install the Cloudfare plugin to make use of Cloudfare. You can find the Cloudfare option under the Website section, Select “Site Tools” then look to the left under the section labled “Speed” you will see the “Cloudfare” option. Cloudfare offers both a free plan and a paid plan. You get better results with the Paid plan but the free plan by itself is great and will significantly reduce your CPU usage.
This helps offload resources to Cloudflare which can save lots of bandwidth and put less stress on your server. To go a step further, login to your Cloudflare dashboard and take advantage of their settings.
7. Blocking Bat Bots
What is a bot? A bot is a software application that automatically performs certain tasks quickly and at scale. It is a tool that can be used for good or bad purposes. Bad actors use bad bots to spam, scrape, scan your site, sending thousands of requests per minute which in turn exhaust your CPU resources.
One way to block bad bots is by the use of the Blackhole for Bad Bots plugin. It is very easy to use and has many rich features. It blocks the bad bots automatically for you.
Another way of blocking batbots is for you to
Examine your site for strange or harmful bots that visit it on a regular basis.
Create a list to keep track of host names or IP addresses that will appear in your security log. Conduct a Google search for each of the host names to determine whether they have been flagged as problematic bots by other website developers.
Bear in mind that you’ll need to conduct some study to determine whether or not a bot is a spam bot.
You will then use the Cloudfare Firewall rules to block these bots from attacking your site.
8. Disable Xml RPC php
What exactly is XML-RPC?
XML-RPC for WordPress was created to facilitate remote communication between your site and third-party apps. This implies that users can connect with their WordPress site via a variety of alternative blogging platforms or mobile applications. This was advantageous in the early days of the internet, when users desired to modify content offline and then post it via their WordPress site.
Certain circumstances will require the use of XML-RPC. However, technological advancements have significantly limited the use and functionality of XML-RPC since its introduction. As a result, the initial benefits of this feature have been exceeded by the potential security dangers associated with leaving it enabled.
What is the purpose of disabling XML-RPC?
There are security issues connected with enabling XML-RPC. These may include the following:
Brute Force Attacks – In this type of attack, an attacker uses xml-rpc to try thousands of username and password combinations until they get access to your site. This is because xml-rpc does not have the same limit on login attempts that WordPress does.
DDoS Attack – A type of attack in which an attacker uses xml-rpc to pingback thousands of IP addresses. This enables them to deliver a deluge of data and traffic, resulting in network outages and even network shutdowns. All this activity can have severe detrimental effects by skyrocketing your CPU utilization.
Please see our article on disbaling XML-RPC
9. Keep your email and web hosting seperate
Keeping your email and web hosting seperate has several advantages. Email consumes a lot of resources and CPU utilization. Having email hosted with a different provider will significantly reduce your CPU utilization, since your hosting and email will not be sharing the same resources.
In addition, if you host both email and your website on one server using the same hosting plan, you risk losing both email service as well as your website being down if there are any outages.
It is best to have dedicated resources just for email and dedicated resources just for your webhosting. You can use Google email or the Microsoft 365 with outlook by pointing your email records to a new provider such as Domain,com for about 5 dollars a month.
Having dedicated resources for email as well as the webhosting is the smart way to go and it significantly reduces your CPU usages.
10. Optimize your images
Make use of a plugin like Smush Pro to compress your images without losing any quality. Smush Pro can compress your images file size by over 80%. This is tern has a positive result on your resources, reducing your CPU usage.
11. Make use of Gzip Compression and Auto-Optimize your files.
In addition make use of the asset Optimization, Compress feature in Hummingbird pro, to inline, combine, defer, or move your files to improve page speed without any coding knowledge. It is a very easy feature to use and all you have to do to enable it is click on a button.
Implementing both Gzip compression and Asset optimization, you will reduce the server load which decreases the CPU demand.
12. Keep your database optimized
It is critical to keep your database optimized in order for it not to consume more CPU resources than necessary.
Siteground offers a database clean up feature that is basic. You can use it by going to the SG optimizer plugin.
Since I have also recommend Hummingbird, that plugin also has a database clean up functionality but both those products are limited in terms of their capabilities. Please dont get me wrong, you can still achieve amazing CPU reduction by leveraging any of those tools.
However, when it comes to cleaning up your database, I have found the WP Reset plugin to be the most comprehensive when it comes to optimizing your database.
Control the use of High CPU limits
Lets face it. The beauty of WordPress is in the amount of available plugins it offers, which ads any functionality you can image to have the website of your dream. Unfortunately not all plugins are created equal. Some are much more resource hungry then others. In addition, other plugins even premium ones that add great functionality consume a considerable amount of CPU utilization. It is your job as a site owner, to go through all your plugins and see which ones you truly need and which ones you can consolidate. Sometimes the functionally provided by plugins can be implemented very easily by changing a couple of lines of Code.
A great tool to use to monitor the utilization of your resources as well as what plugins are consuming what the most resources, is a plugin called Query Monitor which is a free plugin and is very powerful in terms of diagnosing pretty much anything you need to have looked at in WordPress.