Exploring account resource limits

15 August 2013

Today we’re going to take a deeper look at the way we manage account resource limits to ensure our servers are running as fast as possible, keeping your website and email operating quickly.

You’ve almost certainly heard of the two most common limits when it comes to website hosting: webspace and bandwidth – they’ve both been around for almost as long as website hosting has.

Webspace refers to the amount of storage or disk space you’re able to use on your account, usually ranging from a few hundred megabytes (MB) up to many gigabytes (GB).

Bandwidth refers to the amount of data you may transfer to and from your account, usually on a calendar-month basis. What that means is you start on the 1st of the month with no bandwidth used, then during the month as you add content, send and receive emails, and visitors browse your website, your bandwidth usage increases. Bandwidth is usually higher than the webspace, so using many gigabytes in a month is common.

There are other limits servers have beyond those two, however, yet the overwhelming majority of websites will never reach them. We’re primarily interested in ensuring individual accounts don’t consume excessive levels of memory (RAM) and processor (CPU) resources; excess consumption of those, left unmanaged, usually results in a server eventually becoming slow and unstable leading to frequent downtime – something we’ve worked very hard to avoid.

Memory usage, in general, isn’t an issue for a number of reasons:

  • Most scripts are well behaved when it comes to memory usage
  • PHP enforces a 64MB limit on all scripts (on most servers)
  • Having lots of memory in a server is cheap

CPU resources, on the other hand, are not as plentiful. Our servers – and your computer – both have a CPU, or Central Processing Unit. The CPU is responsible for much of the processing a computer does – everything relies on and uses it, and that’s where our monitoring comes in.

How we monitor CPU usage

All accounts are granted 30 minutes of what we call “CPU time” or “CPU minutes” each day. If an account consumes 5 minutes of CPU time in a day it has effectively monopolised the CPU resources for a total of 5 minutes over the course of the day.

Like bandwidth, you start your day with zero usage; throughout the day your usage increases until midnight when it’s reset back to zero again. At midnight all of our servers build a daily report of CPU usage which we monitor internally. Here’s an example of the usage for one account:

 

CPU usage example

This account exceeded the limit on the 14th

Most servers will do between 1,000 and 2,000 minutes of work per day depending on how powerful they are and what they’re doing. A busy website using 100 minutes per day would be using 10% of the server capacity on a server that does 1,000 minutes of work each day.

Tackling overuse

Internally we have been manually contacting overusers and asking them to reduce CPU usage and keep scripts in check. As we’ve grown, however, keeping that up has started to require too much manpower. To reduce the load we have built a set of tools to automatically monitor resource usage on accounts.

Starting immediately, we’ll be sending out an email when you reach 25 minutes of the 30-minute limit. From the 10th of October we will be automatically disabling accounts that reach the limit until the next day, and sending an email to let you know.