The auto-rebalance feature helps in automatically migrating or scaling virtual services when the load on the Service Engines (SE) goes beyond or falls below the configured threshold.
The trigger types that aggregate at Avi Load Balancer Service Engine level are:
- Packets per second (PPS)
- Throughput in Mbps
- Open connections
- CPU
The minimum and the maximum threshold are configured along with one of these options for the trigger type. By default, auto-rebalance is based on CPU trigger type.
Configuring Auto-rebalance using the CLI
The following are the steps to configure auto-rebalance feature on the Avi Load Balancer Service Engine:
Login to the Avi Load Balancer Controller CLI and enter the shell mode by using the shell command.
On prompt, specify the Username and Password.
Optionally, use the switch command to switch to the respective tenant or cloud for which
auto_rebalance
can be configured.switchto tenant tenant-name switchto cloud cloud-name
The
auto_rebalance
option is set to False. To enable it, login to the Controller and setauto_rebalance
to True.[admin:1-Controller-2]: > configure serviceenginegroup Default-Group [admin:1-Controller-2]: serviceenginegroup> auto_rebalance Overwriting the previously entered value for auto_rebalance [admin:1-Controller-2]: serviceenginegroup> save
Configure the auto-rebalance parameters.
configure serviceenginegroup Default-Group auto_rebalance_interval interval-value auto_rebalance_criteria option auto_rebalance_capacity_per_se integer-value
The
auto_rebalance_interval interval-value
provides the interval for which the auto-rebalance will be triggered on reaching the configured threshold. Theinterval-value
is in seconds and the recommended value is 300s. For instance,auto_rebalance_interval 300
.The
auto_rebalance_criteria
option defines the auto-rebalance criteria. The options available are as follows:se_auto_rebalance_cpu
se_auto_rebalance_mbps
se_auto_rebalance_open_conns
se_auto_rebalance_pps
For instance,
auto_rebalance_criteria se_auto_rebalance_cpu
.The
auto_rebalance_capacity_per_se integer-value
defines the maximum allowed value for the specified criteria. For instance, theinteger-value
will be the maximum PPS in the case ofse_auto_rebalance_pps
and the maximum Mbps in the case ofse_auto_rebalance_mbps
. For instance,auto_rebalance_capacity_per_se 200000
.Note: Theauto_rebalance_capacity_per_se
unit for the Service Engine group is set to MBps (megabits per second), and the throughput reported for the virtual service and service engine on the UI is in Mbps (megabytes per second). When entering an integer value for theauto_rebalance_capacity_per_se
option, make sure to consider the correct unit of measurement.Enter Save to save the configuration.
Configuring Auto-rebalance Threshold
The auto-rebalance threshold can be configured based on the SE group. You can use the following commands to configure the maximum and minimum threshold values per SE groups.
The object used to configure thresholds is the same for all the trigger types (max_cpu_usage
, min_cpu_usage
) and is a part of the SE group configuration.
configure serviceenginegroup Default-Group max_cpu_usage value min_cpu_usage value save
The max_cpu_usage value
defines the maximum threshold value for CPU. The value is in percentage. For instance, max_cpu_usage 70
.
The min_cpu_usage value
defines the minimum threshold value for CPU. The value is in percentage. For instance, min_cpu_usage 30
.
Use Case Scenario
This section covers two possible scenarios and the associated configuration.
Scenario 1: Auto-rebalance is based on PPS trigger, with a scale out threshold of 70% (of 200,000 PPS, that is, when it exceeds 140,000 PPS) and a scale in the threshold of 30% (of 200,000 PPS, that is, when it reduces below 60,000 PPS).
switchto tenant Avi switchto cloud azure configure serviceenginegroup Default-Group auto_rebalance_interval 300 auto_rebalance_criteria se_auto_rebalance_pps auto_rebalance_capacity_per_se 200000 max_cpu_usage 70 min_cpu_usage 30 save
Scenario 2: Auto-rebalance is based on open connection triggers, with a scale out threshold of 60% (of 5,000 open connections, that is, when it exceeds 3,000 open connections) and a scale in threshold of 20% (of 5,000 open connections, that is, when it reduces below 1,000 open connections).
switchto tenant Avi-azure switchto cloud azure configure serviceenginegroup Default-Group auto_rebalance_interval 300 auto_rebalance_criteria se_auto_rebalance_open_conns auto_rebalance_capacity_per_se 5000 max_cpu_usage 60 min_cpu_usage 20 save