Automatic Horizontal Scaling
This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.
Click or tap a screenshot to view it at its original size.
Objective
This guide explains how to use Automatic Horizontal Scaling on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.
Before you begin
- Sign in with an account permitted to manage the relevant environment.
- Confirm the target environment, region and resources before saving changes.
- Create a backup or rollback plan before changing a production system.
besidesAutomatic vertical scalingThen Ruk-Com Cloud PaaS can automatically scale nodes horizontally. By changing the number of containers insideLayers(nodeGroup) according to the incoming load In this case, all instances within the same layer are allocated equally to the available hardware set (hosts) using anti-affinity rules. That is, when a new container is created, Containers are placed on hosts with the least number of instances from the same layer and with the minimum load mark guaranteed.High reliability and availabilityof the hosted project

Automatic horizontal scaling with the help of adjustable triggers, which are custom conditions for adding nodes (scale-out) and withdrawing them (scale-in) based on the load, analyzes the average minute resource usage (for the number of minutes specified within the trigger) to decide if node scaling is required.
At the same time, statistics are collected for all layers, so that if there are 3 nodes with 20%, 50% and 20% load respectively, the calculated average is 30%. The in/out scaling conditions are independent, that is, the analyzed duration for one period is not reset when another period is executed.
In the sections below we will outline how to:
Setting triggers for auto scaling
To configure the trigger for automatic horizontal resizing, follow the steps below.
More:When scaling certified server applications (not custom Docker containers) In environments that do not have load balancers, NGINX will be added automatically. This is the case if you want to use another program for your server application. You should manually add the load balancer on the first scale.
1. Click on the buttonSettingfor the desired environment

2. In the settings bar that opens, go to the "Configuration" section.Auto Horizontal Scaling

Use the buttons on the tools panel to manage automatic horizontal scaling for the environment:
- Add- Create a new trigger
- Edit- Modify existing triggers
- Remove- Remove unwanted triggers
- Refresh- Updated list of trigger scaling.
ClickAddto carry out
3. Select the desired environment layer from the drop-down list and select the resource type to monitor through one of the appropriate tabs (CPU, Memory, Network, Disk I/O, Disk IOPS).

Tips:
- The master node can be used as a storage server for sharing data within the entire layer as well as additional nodes through automatic horizontal scaling.
-The calculation of CPU and memory limits depends on the number of allocated cloudlets (a special unit of Ruk-Com Cloud that represents 400 MHz CPU and 128 MiB RAM at the same time).
4. The graph on the right shows the usage statistics of the selected resource. You can choose the desired duration for displaying data. (up to one week) by selecting from the drop-down list and, if necessary, You can turn on/off the function.Auto Refreshof statistics

You can also hover over the graph to see how many resources were actually used over a period of time, using this information to set the right conditions for your trigger.
5. Each trigger has its own conditions.AddandRemove NodesThis can be enabled by checking the following boxes.

Both configurations work similarly:
- When loading is more (less) than -Percentage upper (lower) limit for the average load (i.e. trigger a trigger if exceeded).
- Tips:The desired value can be specified using the appropriate slider on the graph.
- A trigger value of 100% will disable it.Add Nodesautomatically and 0% -Remove Nodes
- The minimum allowed value between the node addition and deletion conditions is 20%.
- Mbps unit can be selected for trigger.networkinstead of percentage
- We recommend setting the average load for the Add Nodes trigger above the 50% threshold to avoid unnecessary scaling (i.e. wasted resources/funds).
- For at least -Number of minutes for which average consumption is calculated. (Up to one hour with 5 minute steps such as 1, 5, 10, 15, etc.)
- Scale out (in)- Maximum (minimum) number of nodes for a layer configurable due to automatic horizontal scaling.
- Scale by- Number of nodes to be added/removed each time when the trigger is fired.
When configuring the trigger, we recommend taking the layer's scaling mode into account. For example, you should set a lower loading percentage in the Add Nodes trigger for stateful mode, because cloning content takes time. This is especially true for containers with a lot of data) and you can access limited resources before creating a new node.
6. You will automatically receive email notifications about configured Auto Horizontal Scaling trigger events by default. However, if you don't want to receive emails, you can disable them with the toggle.Send Email NotificationsON/OFF

7. In the section below the platform Contains the following buttons:
- Undo Changes- Return to the state before the change (for editing only)
- Close- Exit settings without changes.
- Apply (Add)- Confirm changes for triggers

Viewing trigger execution history
You can view the history of trigger scaling operations for a particular environment.
In the example below we will use high load for 5 minutes (see RAM usage statistics in the image below) on an application server with the following triggers configured:
- add nodeWhen the average RAM load is greater than 65% for at least 5 minutes.
- remove nodeWhen the average RAM load is less than 20% for at least 10 minutes.

Let's take a look at automatic horizontal scaling:
1. Go to the sectionSettings >Auto Horizontal Scaling Click the buttonHistory

You can also choose the duration to display the trigger list through the options.FromandTo
2. The details of each item are as follows:
- DateDate and time of the trigger action.
- ActionAn operation (adding or removing a node) was performed.
- NodesNode type used for scaling
- InfoInformation about trigger execution conditions

Additionally, when hovering over the recorded data you can checkLoading Valueadditional (use of resources during the period of operation) andNode Count(number of node results)
Adding and deleting trigger nodes are independent of each other. Therefore, the removal condition (Average load less than 20% for at least 10 minutes) will not be reset and will continue to be monitored even after adding new nodes. This method allows for faster detection of adequate load averages over a given period of time. It is recommended to set a different value between scaling out and scaling in limits to avoid frequent topology changes.
This way you can configure adjustable trigger sets to ensure your application's performance and track automatic horizontal scaling directly through the dashboard.