Scaling
Applications experience different amounts of load and traffic. Sometimes requests may grow so much that the application can't respond to them, and users see errors. The way to prevent these disruptions is scaling, meaning increasing the application's resources or similar instances and distributing the load among them.
Traffic growth may also be temporary and happen only at certain hours of the day. In this case, scaling manually can be time-consuming and difficult. On the other hand, if a lot of resources are allocated to the app at low load, you have to pay a lot for unused resources. Autoscaling in the Arvancloud Cloud Container is a feature that can meet this challenge.
In general, there are two types of scaling in infrastructure:
- Vertical: Vertical scaling lets you change the application's resources (RAM / CPU / ephemeral storage).
- Horizontal: Horizontal scaling lets you change the number of the application's instances.
Vertical Scaling
If you need to increase or decrease an application's resources, including RAM, CPU, or ephemeral storage, click the application's name in the Arvancloud panel and go to Settings.
On this page, in the Vertical Scaling section, specify the resources you need and finally click Apply.
Note that this process causes no interruption in your application's operation.
Horizontal Scaling
With horizontal scaling in the Arvancloud Cloud Container, which is equivalent to HPA in Kubernetes, you can instantly increase the number of your application's containers so you can implement load balancing scenarios to automatically divide the load among different Pods. Horizontal scaling lets you create several instances of your application with just a few clicks. You can do this both manually and automatically.
Note that this feature can only be used for applications without disks (stateless services). If a disk (Persistent Storage) is enabled on your application, you can't use manual or automatic scaling.
To change horizontal scaling, click the application's name and go to Scaling.
Manual Scaling
With manual scaling, you can create as many identical instances of the application as the number of Pods you define. Load balancing is then automatically enabled on them so a roughly equal load flows to the Pods. This can be defined and changed at any time and is recommended for users who usually have a steady load on the application.
Note that reducing the number of Pods to zero disables the application and makes it unavailable.
Autoscaling
With autoscaling, when the load on the application's processor increases, similar Pods are created automatically and the load is divided among them. In fact, the user specifies how many Pods the application has at peak traffic; for example, when CPU usage reaches a certain value, a Pod is added and the load is distributed. If CPU usage reaches this value again (and the maximum number of Pods set is more than 2), another Pod is added. This continues until the maximum number of Pods is reached.
First, set the processor usage threshold. This value determines at what processor usage Pods are created and load balancing is enabled. Then, by setting the number of Pods, you can define how many instances of the application are created.
After you select Apply, when the CPU load increases to the specified amount, the defined number of identical instances of the application is created automatically and the load is divided among them, to prevent performance problems caused by a lack of resources.