Get Virtualizor

Vertical Scaling

Overview

Vertical scaling refers to adding more resources such as CPU/RAM to your Virtual Machines based on a particular threshold as on demand. In Vertical Scaling, resources can be upgraded when required and downgraded to original state when load goes below threshold.

Requirements

  • Virtualization: KVM only
  • Will work only for Linux VMs
  • QEMU version >= 1.25
  • Requires PRO license

Understanding & Setting up Vertical Scaling

Vertical Scaling simply scales Virtual Machines resources based on threshold set by the admin or the user. This ensures that the Virtual Machines doesn’t loose its performance during peak load.
Scaling is performed on hourly basis.

Setup

Vertical Scaling can be setup in global or per VM basis ways.
There are different field present for scaling which are explained below.

Max Ram

This will set the maximum amount of RAM that can be assigned to any Virtual Machine.

RAM Threshold

This is the trigger value for RAM, after surpassing this value, scaling will be performed.

Increase/Decrease RAM

This is the amount of ram that gets assigned to the Virtual Machine during scaling profile.

Max CPU Cores

This will set the maximum amount of CPU core that can be assigned to any Virtual Machine.

CPU Threshold

This is the trigger value for CPU, after surpassing this value, scaling will be performed.

Increase/Decrease CPU Cores

This is the amount of CPU cores that gets assigned to the Virtual Machine during scaling profile.

Global Setting/ Default Setting

image

Per VM setting available in Create VPS and Manage VPS

image

ManageVPS

image

End-User

image

Billing

Additional RAM/CPU prices that is assigned to the Virtual Machines are calculated on basis of Resource pricing. Hence pricing is calculated on hourly basis itself.

Simulate Vertical scaling

1 a) For vertical scaling, you will need to set your values globally in Master settings or apply it in Create VPS / Manage VPS for existing VPS :

vertical-global

1 b) Once the Cloud user's Sub-user orders the VPS from Cloud panel, his VPS would be allowed for scaling vertically based on the settings applied here or the settings applied from Admin/Enduser panel for that specific VPS :

vertical-vps

(manage VPS on Admin panel)

Cloud user or Admin/root User can override Global settings per VPS by changing it from Admin / Cloud panel . You can also have it in your plans.


2) To test scaling options, you can try using stress command in VPS.
To install :

yum install -y epel-release && yum install -y stress (CentOS 7.x And AlmaLinux 8.x)

apt install stress (Ubuntu)

After installing, run the stress command within the VPS :

stress --cpu 4 (use ctrl + c to cancel)

Stress is for 4 full CPUs while the VPS is originally using 2 cores only.
This kind of usage will get detected and then the scaling would happen.

3) And use another ssh session to monitor VPS resource usage :

watch lscpu

In the following screenshot, I have opened stress command terminal on right and the top left one is the another session of VPS  to watch lscpu and below that is the server's terminal which is hosting the VPS.

vertical-simulate

(right one is trying to over-load the CPU and top left is checking VPS CPU count and cronm.php was run on the slave server)

Virtualizor panel will check every 8 minutes if any VPS has to be scaled. 
(cronm command: /usr/local/emps/bin/php /usr/local/virtualizor/scripts/cronm.php)

As per previous screenshot, it checked for my test VPS and scaled the VPS to 4 cores
( you can view the message in screenshot : Increasing CPU core to : 4 core

Since it scaled the VPS now, it will wait for an hour and then again either try to Increase by 2 more cores or scale it down to 2 cores depending on the threshold values set per VPS or Globally vs the usage within the VPS.

Note
The VPS will be charged as per hourly resource pricing set on Virtualizor panel.

Troubleshooting

Can't see Scaling option?
1) Make sure that vertical scaling is enabled.
2) Supported Virt: KVM only
3) Billing is enabled for the Cloud user.
4) You have pro license for that node.
5) Resource pricing needs to be enabled from left menu as well.
6) Check for any stuck cronm on the server which is hosting that VPS.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list