Understanding Resource Limits CPU, RAM, and IO Usage in Web Hosting

What limits are imposed on a shared server?

Each provider decides the limits of hosting resources based on different evaluations, which include not only a technical part but also a commercial part. For example, some providers offer unlimited RAM, but limit processes as much as possible in order to promote this feature. While others make more balanced choices.

You will hardly find two different providers that have the same limits unless they have copied each other.

Everyone knows what disk space and monthly traffic are, but what about the other hosting resource limits? What are they? What do they mean?

Checking your current usage

It is possible to check your current resource Usage via cPanel account. Log into your hosting panel and navigate to Stats widget on the left:

CPU Usage

If your hosting account (i.e. your website or websites) exceeds CPU usage that has been allocated for you, your website(s) will become very slow and can even time out. And then, when your website’s load decreases, your website may get back to normal again.

Technically, the hosting sets this limit in terms of percent of a single CPU core or as a fixed amount of Hz. And if you exceed 100% usage, it means that you loaded not the whole server, but only your CPU share is exceeded.

High CPU usage is just one of the reasons why you website may slowdown occasionally.

Usually peak CPU usage may last for a short period of time. Otherwise, it means that something is wrong. Hopefully, your website has become simply popular. If it’s not the case, then you need to analyze the cause of the higher CPU usage.

Virtual Memory Usage

Virtual memory is the memory allocated for processes which run run on your account. Usually this is a file that is stored on a disk.

Here’s a simple example of using virtual memory. When your website page gets opened it eats up some virtual memory. So, the more visitors are on your site and the more they are active,the more virtual memory will be consumed during this period of time. If your virtual memory limit is exceeded, then your visitors will get Out of Memory errors (HTTP 500 and 503 errors in the browser).

Another example is that you publish a huge post. And if it goes out of your physical memory, the virtual memory is used to finish the operation.

The reasons for exceeding virtual memory are similar to the reasons for high CPU usage. In short, the heavier your website is and the more visitors it currently has, the higher the virtual memory usage is.

Physical Memory Usage (RAM)

RAM is the actual memory allocated for your account. Virtual memory is usually a file on a disk drive that the operating system uses to store information (swap-to-from) when the real memory becomes full, for instance, the page (swap) file on a Linux system. Therefore, if you try to publish a big post, it might take all physical memory to do so, but after some time it will be normalized.

If this value reaches the limit you may begin to experience PHP errors (if applicable) on your website, or in very extreme cases may see a CloudLinux error page. These errors are typically only brief and once the usage has reduced to below the limit, will automatically clear.

Input/Output Usage

This limit (KB/s) restricts how much data is written per second to the disk. If there are highly intensive disk writing processes running on your account (e.g. you are generating a backup) and you go over the limit, the running processes are postponed to get you back to the limit. In other words, it means that your website becomes slower until your I/O usage gets back within the allowed limit.

Here’s a short case from my experience:

One day on one of my websites I noticed that the website speed fluctuated quite a bit by suddenly slowing down for a short period of time. It happened rarely, and most of the time the website sped was good.

I quickly analyzed the IO Usage chart and I found out that IO Usage was close to the limit. And periodically it peaked out. By raising the IO Usage limit (i.e. upgrading the plan) the performance issues ended.

Input/Output Operations

This metric is similar to the precious one. But this one regards not the amount of data written to the disk, but the number of disk writing operations per second. This limit let a shared hosting to avoid situations when users abuse the server resources by running a lot of simultaneous processes that write to the disk.

You will not notice any performance issues until you exceed this limit. If you exceed the number of IO operations, the excessive processes will be postponed. It will result in slowing down the performance of your website.

Check your account usage

If your provider uses CloudLinux and has enabled the feature you can see the consumption directly from cPanel, in a few clicks.

After logging into cPanel scroll down to the “Resource Usage” section and click on the resource usage tool.

On the main page you will see if there have been recent blocks or not:

By clicking on Current usage you will see a series of graphs, which are generated in real-time based on consumption.

Let’s take a look at a graph for each of the limits I explained above, and see how many resources our site is actually using.

This allows us to:

  • Verify if the provider is lying to us about the limits
  • Verify in real-time the resource usage and evaluate whether or not we need to upgrade to a higher plan.

In the Snapshot section, we can see a “snapshot” of the moment we received the last block, so we can understand what may have caused the limit to be reached and prevent it from happening again in the future.