Creating a managed instance group with enabled auto scaling¶
To create a managed instance group and configure its auto scaling, perform the following steps:
Navigate to the Instance groups page in the Compute Engine section of the menu and click the Create instance group button.
Enter the instance group name into the Name field.
Select Managed instance group in the Group type setting.
Enable auto scaling for the instance group by selecting the On option from the Autoscaling drop-down list.
Select the required scaling policy from the Autoscaling policy drop-down list.
Scaling policies contain rules for increasing and decreasing the size of the instance group. The system determines when it should add or remove an instance from the group to keep the metric on which the policy is based at the target level defined by the user.
You can select one of the following policies:
- CPU Usage: The size of the group is controlled to keep the average processor load of the virtual machines in the group at the required level (CPU usage policy documentation).
- HTTP Load Balancing Usage: The size of the group is controlled to keep the load of the HTTP traffic balancer at the required level (HTTP load balancing usage policy documentation).
- Stackdriver Monitoring Metric: The size of the group is controlled to keep the selected metric from the Stackdriver Monitoring instrument at the required level (Stackdriver Monitoring Metric policy documentation).
- Multiple Metrics: The decision to change the size of the group is made on the basis of multiple metrics (multiple metrics policy documentation).
This guide uses the CPU usage policy to demonstrate the principles of working with the auto scaling mechanism.
To apply this policy, specify the required average processors' load level in the Target CPU usage field (in percentages).
Specify the minimum instance group size in the Minimum number of instances field (e.g., two instances).
Specify the maximum instance group size in the Maximum number of instances field (e.g., 10 instances).
Specify the period of time during which the metric values should not be recorded from the newly added instance in the Cool down period field (e.g., 60 seconds). This may be necessary if you see resource consumption leaps after adding a new instance.
Cooldown period requirements
The cooldown period must be longer than the time required for instance initialization.
Make sure all of the parameters of the instance group are configured correctly and then click the Create button.
The specified number of instances will automatically launch upon the successful creation of the auto scaling group.
You can check that the auto scaling group was created correctly by viewing the number of launched instances in the group and comparing this data point with the number of filtering nodes connected to the Wallarm Cloud.
You can do this using Wallarm Console. For example, if two instances with filtering nodes are concurrently operating, Wallarm Console will display this number for the corresponding cloud node in the Nodes section.
You can now proceed with the creation and configuration of a load balancer.