Common Causes and Solutions to Excessive Resource Usage

Any time our systems administrators flag your account for excessive resource usage, we try to provide the option to either reduce your resource usage, or upgrade your account to a VPS or Dedicated platform.

Common causes of excessive resource usage

In the previous article we talked about CPU and memory usage. Now that you have a basic understanding of server resources, we going to cover common reasons accounts will use resources excessively.

MySQL activity

This can mean many different things. MySQL refers to your site’s database(s). For example, if you have a WordPress website, it uses MySQL to store your website’s content in a database.

If your website has long running MySQL queries (asking the database for too much information) or excessive amounts of querying (asking the database for more information repetitively) it can cause your website to load slowly or even crash.

Poorly coded Scripts, Plugins, or Modules

It’s a common misconception that all websites have the same CPU / Memory usage. This is not the case though. For example, a WordPress website with a default theme and no plugins uses far less memory than another WordPress website with a custom theme and 20 plugins. Also, keep in mind that a website with one poorly coded plugin can cause CPU and memory usage than a website with 20 well-coded plugins.

Sometimes it’s as simple as updated your plugins and scripts to the latest versions. Most developers will update their code to address resource usage and fix security holes. If your website is custom coded you may need to examine the code or contact the developers who built the website for you.

Cron Jobs running too often

Cron Jobs are basic task schedulers. This allows you to schedule a script to run in specific increments like every minute, every hour, or every day. Cron jobs that aren’t configured properly or ran too often can cause high server loads which can affect how your site loads.

High Traffic

High traffic isn’t a bad thing. This means your website is getting a lot of visitors and is probably a goal for you. A great way to look at this is using a basic fish analogy:

  • Let’s say you buy a small fish and a tank for it to live in. Eventually, the fish grows and is happy and healthy. However, at some point, this fish may have grown too big to live comfortably in the original fish tank you purchased. It may be time to move to another tank to ensure your fish remains happy and healthy.

The same applies for web sites. You have simply outgrown your current hosting plan and it may be time to upgrade to a different plan that better suits the needs of your website. Please read our article for more information on upgrading your account.

Search Engines Overly Crawling Site

At times, we see our customer’s sites being crawled excessively by search engine bots. Having your site indexed by the search engines can be important so people can find your website. There comes a point where the search engines can be over crawling your site which can affect your site’s ability to function as you have intended it.

Over-crawling your site can mean different things. Google and other search engines can be crawling too many pages of your website, especially ones that you do not want the public to see. Also, over crawling can mean they are making too many requests to the server. To resolve this please review our article on setting a crawl delay in Google Webmaster Tools or how to stop search engines from crawling my site.

What do to if your server is using excessive resources

In some cases it may not be possible to decrease your usage to levels that are acceptable on a shared hosting platform. Sites that require larger databases or are controlled by server-driven software (like PHP, Python, and Perl) and/or have larger images and files being hosted naturally require more resources in order the function properly. Resources usage intensifies as traffic increases, which is why higher-traffic server-interactive sites tend to outgrow a shared platform more easily than static HTML sites. If your site is generally too resource-intensive for a shared system, an upgrade may be in your best interest.

Keep in mind, we cannot offer programming assistance or support for third-party software, and we cannot provide definitive solutions to decrease your usage. However, when possible we can offer tips and suggestions that have helped other customers in similar situations.

Any site has the potential to be resource intensive, but some software has a greater potential to use more system resources than others. Software we commonly see associated with high resource usage are listed below:

Enabling Caching

Since PHP and MySQL are server-side languages, the server has to compile every PHP page and process every MySQL query. If your site uses PHP or MySQL , caching can reduce your resource usage and improve the performance of your website load times. Caching stores PHP pages as static HTML files, so the next time the page is loaded, the HTML page is loaded instead. If you are using a Content Management System such as WordPress or Drupal, you likely have a caching system in place or can download a third party plugin to help with caching.

Optimizing MySQL

As databases grow they may need to be re-indexed. Indexing databases help speed up how data is retrieved when a query is ran. This reduces how hard the server has to work to get the data. Think of database indexes as a table of contents in a book. The index or table of contents allows the server to go to the specific place where the data is stored without having to “read” the entire database.

The easiest way to accomplish this is by logging into your cPanel > phpMyAdmin and running the ‘optimize’ or ‘repair’ commands against your database. Please read our article on How to Use phpMyAdmin to optimize a database.

Enabling Hotlink Protection

Hotlinking is more common with sites that serve a lot of images, such as gallery sites. Hotlinking is a term that describes when another site directly links to images on your site, and is generally frowned upon and described as “bandwidth stealing.” You can enable hotlink protection in your cPanel, but be sure to include your addon/parked/sub-domains in the ‘allow’ list so that all your sites function properly. Please see our article on Enabling Hotlink Protection for more information.

Using a Robots.txt File

Search engines and robots can account for a large percentage of a site’s traffic, and most of this traffic can be unnecessary so reducing it can save a lot of resources on the server. You don’t want to eliminate search engines altogether, but you should restrict them from being able to access directories that don’t contain content you need indexes, and you should block unfamiliar bots and spiders that are frequenting your site. You can identify the spiders and bots crawling your site by looking at your AWstats, and restrict their activity using a robots.txt file. Also, they may be crawling your website too quickly. You can use Webmaster Tools to set a crawl delay to help in this case. Please see our article on how to block search engines from crawling my site and our article on how to set a crawl delay using Webmaster Tools.

Upgrading your hosting plan

If your website is using a large amount of system resource it isn’t always an issue with the site or coding. It’s not uncommon for popular websites to start out on a shared hosting platform and eventually outgrow it.

If this is the case, typically our systems administrator’s will notify you of the plan you’ll need to upgrade to that will provide minimum platform requirements to meet your site’s resource usage. For more information please see our article on upgrading your hosting package in AMP.

In most cases when you choose to upgrade we will handle moving your account over to the VPS or Dedicated server, and most moves do not result in downtime for your site(s).

Was this article helpful? Let us know!