19 February 2021 Reading time: 10 minutes

Yuri Bogdanov

CEO of FIRSTBYTE hosting

How to manage overselling. Experience of FIRSTBYTE

How to manage overselling. Experience of FIRSTBYTE

 

ISPSystem

Yuri Bogdanov, CEO of FIRSTBYTE hosting, explains why VDS/VPS hosting providers usually oversell resources and how to make sure the clients stay satisfied.

ТVirtualization technologies

Virtualization was created in order to distribute computing resources between different environments, each running on its own operating system. In this case, hard disk space is shared by different operating systems. Processor cores and RAM are also distributed. Each virtual machine gets a dedicated set of resources isolated from the others. These settings are suitable for virtual machines that consume large amounts of resources continuously. They provide guaranteed performance and resources availability at all times.

But as a rule, virtual machines do not consume all the allocated resources all the time. The spare capacity is idle, and equipment is not being used optimally. Overselling helps to solve this problem.

What is overselling

Overselling is a technology that allows more computing resources to be allocated to users in total than is physically available on the hardware.
Overselling is implemented on specialized virtualization platforms (OVZ, LXD, KVM). Each of them uses a different set of technologies and different parameters available for overselling.

Let's look at an example of overselling based on OVZ technology. Four virtual machines with 32 GB of memory can be created on one physical server with 128 GB RAM, thus distributing all the memory. In OVZ technology, all virtual machine processes run in a single RAM space. Let's say, according to statistics, we see that virtual machines on average do not consume this amount of memory, and the system always has 60-70 GB of free memory. This way, we can assign more available memory to virtual machines (e.g. 48 GB). At the same time, we will be sure that at any time there will be enough resources for virtual machines. Using these four virtual machines as an example, we have allocated a total of 192 GB of RAM instead of the 128 GB available.

An example of overselling. The physical limit of the server is 128 GB RAM.
But users have more resources available - total 192 GB of RAM

As a result, each user will get more RAM. This is possible because virtual machines rarely use 100% of their resources.

You can oversell a variety of resources:

  • Data transmission network. The network is common to all clients, and in practice it is always oversold. It is rarely used to 100%
  • CPU time. Modern processors are multi-core. Processor restrictions are made by specifying the available number of cores for the virtual machine. Restrictions directly by CPU time are rarely needed. Only sophisticated virtualization systems, such as VMware, allow you to limit CPU time. Core allocation is available in almost all virtualization systems.
  • RAM is oversold if OVZ or LXD virtualization is used. KVM-based virtualization systems allow RAM to be allocated and rigidly reserved for a virtual machine without overselling.
  • Disk space, is usually immediately available for overselling in OVZ, LXD and KVM technologies, if the file type storage of virtual machine images is used. If you allocate memory via LVM, overselling becomes impossible: hard disk space is rigidly reserved for the client.

Why hosting providers oversell

To reduce the cost of services
Without overselling, the cost of virtual machines would be many times higher than what is offered on the market. For example, a client can buy a virtual server for 500 rubles, but without overselling he would pay 3000 or more for the same set of resources.

To improve utilization
The hosting provider incurs direct costs for the purchase of server hardware. These are CPUs, RAM, HDDs or SSDs. So if it has 256 GB of RAM, all of it needs to be allocated to clients. And if customers use only half of those resources, it means that 50% of the capacity is idle, although it could be used. The magic is in the competent utilization of the resources available to the provider. And doing it in such a way that each client has enough capacity, even if it starts to use all 100% of the resource.

Overselling has limitations

If RAM overselling is applied and all clients start using it, there will not be enough total RAM and applications will get a memory allocation error. This will make it impossible to start new processes. A similar situation can happen when you oversell disk space. These things must not happen.

CPU time is the most common resource for overselling. A few years ago, when mining was popular, virtual machines were often hacked and mining software was run. It consumed CPU resources excessively. There were also clients who deliberately ordered an inexpensive VDS and loaded the CPU to its full capacity. This had a massive character, and CPU resources would become insufficient. As a result, servers were starting to run slowly. Measures had to be taken to block the ability to run this specialized software. Providers were calculating unscrupulous customers and reporting the breach. This overuse was not critical, but only slowed down the servers.

Now hosting providers have more than enough I/O system performance of modern SSD and NMVe disks and network. The limits on these resources are usually not exceeded.

More often than not, providers do not mind customers consuming all available CPU time when they need it. But if it happens all the time and with a large number of customers, the resource of the equipment is insufficient. This happens when the server is not used to run websites and client services, but for high-load parsing, large torrent trackers, continuous compression or transcoding of audio-video information.

How to arrange overselling in an optimal way to keep clients happy

Choose an overselling model

The provider's job is to make sure that clients get all the resources they need and that there is enough computing power on the equipment for both current and new clients.

It is necessary to determine which parameters will be oversold by the hosting provider: what policy he will choose and what will be the balance between price and overselling.

At FIRSTBYTE, we are developing virtualization based on KVM technology. We use overselling of CPU time and network. RAM and disk space, being the critical parameters for work, are allocated on guaranteed basis.

In OVZ virtualization, overselling is applied automatically to all parameters: CPU, disk space, RAM and network. Careful monitoring of available resources is necessary here.

Set up monitoring

To make overselling invisible to customers, experienced providers pay attention to monitoring of computing resources. Various well-known systems can be used for this, such as Casti, Zabbix, Grafana. Monitoring should show the distribution of clients over equipment, CPU load, RAM, network load. Even if clients' workload increases dramatically, they will remain happy because they will continue having enough resources.

We at FIRSTBYTE use ISPsystem software and Zabbix and Cacti systems for monitoring. We also use our own developments. They are integrated via API with ISPsystem platforms and collect statistics, analyze them according to our special algorithms, provide information and notify if needed. The statistics system is updated once an hour. It checks that the infrastructure always has a reserve of computing resources (CPU, RAM, disk space and network capacity) for the current users and in case of increased load. Among other things, we always keep backup equipment in hot standby, ready to expand cluster resources. Systems are monitored 24/7.

Our system determines the average load on virtual servers, resource utilization and tracks anomalies. If we see some virtual machines exceeding the resource usage - CPU or network - suddenly and for a long time, it is likely that such machines have either been hacked or the software has failed and started abnormal resource consumption. We let customers know about it and thus help them with the software setup.

Through monitoring, we can distribute clients at our equipment in a way that is comfortable for them, so that everyone can get the resources allocated to them in full. Once a month, we review statistics and analytical data, and optimize settings.

Even if a large number of customers start producing a high load on the equipment, we will nevertheless all provide the necessary resources.

For customers with important resource-intensive tasks, our FIRSTBYTE range of tariffs contains the Business series with permanent guaranteed resources without restrictions.

How to set up overselling and keep customers.

Tips to a hosting provider

  • Decide which parameters to oversell depending on your equipment budget.
  • Develop a system to monitor these parameters so that customers always have enough resources.
  • Properly configure the overselling configuration in the virtualization software.
  • Specify in the contracts what resources are available to customers and what restrictions there are on their consumption. For example, how long you 100% of the CPU time can be used and how much traffic per month is allocated per virtual machine.