This article will discuss vertical and horizontal scaling which can help you handle an increase in the number of visitors.
Types
In general, there are two ways in which you can scale an application: vertical or horizontal.
Vertical scaling
As you will receive more traffic for your websites you might observe a high load on the Virtual Machine. This is especially true when you have initially created a small machine that was designed for testing.
If you need to increase the resources available for the virtual machine please do the following:
-
Navigate to Virtual Machines
-
Click on the options for the Virtual Machine (triple dots at the end of the row)
-
Select Change Instance Type
-
From the menu please select an option that is suitable for you
-
Select Continue
-
Select Deploy
Notes
-
When the resize process starts there will be a downtime of approximately three minutes.
-
You can scale it down as well as long as the root disk size does not increase.
-
If you do not wish to increase the root size of the disk make sure that the Resize root disk is turned OFF.
Horizontal scaling
Horizontal scaling can be achieved when your application was created on a WebServer with the application data folder shared via NFS between instances.
To achieve this type of setup:
-
Create a New Application
-
Select on a new server
-
Set the following options
-
Web Server Type to Load Balanced
-
MySQL instance to new (unless you already have a MySQL server)
-
NFS server to new
-
-
After the template application is installed, migrate your application to the new infrastructure
Notes
-
This type of setup is more advanced and it creates (at a minimum) 3 instances.
-
Once you created the WebServer you will observe new options (namely Scaling and Auto Scaling) that will allow you to scale the number of instances up and down as the load increased or decreases.