Create a custom auto scaling policy

Updated at:
Copy as MD

A custom auto scaling policy uses multiple scheduled rules to adjust node counts to target values at specified times. It is suitable for workloads with a predictable schedule. For example, scale out Data Nodes during daytime write peaks and scale them in at night to avoid slow index building and query fluctuations during peak periods, as well as idle resources during off-peak periods.

Limits

This policy is displayed on the Auto Scaling Configuration page of the console as Auto Scaling Rules (Scheduled). Only one auto scaling policy can be enabled for an Alibaba Cloud Milvus instance at a time. If your workload does not follow a predictable schedule, we recommend managed auto scaling, which lets the system determine when to scale within a specified capacity range. For configuration instructions, see Create a managed elastic scaling policy. After you switch policies, the rules of the previous policy stop taking effect but are not deleted.

  • Auto scaling is supported for Standard Edition instances. Basic Edition instances do not support auto scaling.

  • The instance status must be Running. Auto scaling policies cannot be configured when the instance is in another state.

  • The engine version must meet the minimum requirement for the node type, as shown in the following table. If the instance details page does not display the Auto Scaling tab, the engine version or specifications of the instance do not support auto scaling.

  • You can configure up to 10 scaling rules for each node type. Multiple rules for the same node type cannot be scheduled for the same time.

  • An instance has only one Time Zone. Rules run based on this time zone (such as Asia/Shanghai), without cross-time-zone conversion.

  • The metadata service does not support auto scaling. The available node types vary with the engine version, specifications, and deployment configuration of the instance. Refer to the options displayed on the page.

The following table lists the minimum engine versions required for auto scaling of each node type.

Node type

2.4

2.5

2.6

Data Node

2.4.23-0.4.3_3.8.0 or later

2.5.12-0.6.2_3.8.0 or later

Supported

Index Node

2.4.23-0.4.3_3.8.0 or later

2.5.12-0.6.2_3.8.0 or later

-

Query Node

2.4.23-0.5.0_3.11.0 or later

2.5.12-0.7.0_3.11.0 or later

2.6.18-0.1.3_3.11.0 or later

Proxy Node

2.4.23-0.5.0_3.11.0 or later

2.5.12-0.7.0_3.11.0 or later

2.6.18-0.1.3_3.11.0 or later

Streaming Node

-

-

2.6.18-0.1.3_3.11.0 or later

Metadata service

Not supported

Not supported

Not supported

Note

For an instance running an earlier version, upgrade the engine to use auto scaling. For instructions, see Upgrade versions.

Billing

  • Subscription instances: Total instance resources = baseline resources + elastic resources. The baseline resources are billed on a subscription basis and are excluded from auto scaling. The elastic resources are billed on a pay-as-you-go basis. You must first manually enable the PASG Resource Group.

  • Pay-as-you-go instances: The PASG Resource Group is enabled by default. Baseline and elastic resources are not distinguished; all resources belong to the pay-as-you-go resource group.

  • Nodes added through auto scaling are billed based on their actual usage duration. Billing stops after the nodes are released during scale-in.

Step 1: Open the Auto Scaling page

  1. Log on to the Alibaba Cloud Milvus console.

  2. In the left-side navigation pane, click Instances.

  3. In the top navigation bar, select the target region.

  4. In the instance list, click the name of the target instance.

  5. On the instance details page, click the Auto Scaling tab.

Step 2: (Optional) Enable the pay-as-you-go resource group

Elastic resources used by scaling rules are billed on a pay-as-you-go basis. The pay-as-you-go resource group is enabled by default for pay-as-you-go instances, so you can skip this step. For subscription instances, enable the pay-as-you-go resource group before you configure scaling rules.

  1. On the Auto Scaling Configuration page, check the status of PASG Resource Group.

  2. If the status is Disabled, click Enable PASG Resource Group. In the confirmation dialog box, click Enable.

  3. After it is enabled, click Configure PASG Resource Group to manually adjust the node count of the pay-as-you-go resource group:

    • Scale-out: The maximum node count is 50. For a high-availability instance deployed across two zones, the step size is 2. The node specifications of the pay-as-you-go resource group are the same as those of the baseline resources and cannot be changed.

    • Scale-in: The minimum node count is 0. For a high-availability instance deployed across two zones, the step size is 2.

    Note

    During auto scaling, the instance briefly enters a scaling-out or scaling-in state. You cannot make other configuration changes to the instance during this period. While a rule is running, you cannot edit, disable, or delete it.

Step 3: Add a scaling rule

  1. On the Auto Scaling Configuration page, select Auto Scaling Rules (Scheduled).

  2. Click Add Scaling Rule.

  3. In the Add Scaling Rule dialog box, configure the following parameters, and then click OK.

Parameter

Description

Rule name

Required. The name must be 1 to 64 characters long and cannot contain special characters. Rule names must be unique within an instance.

Execution interval

Required. If you select Every Day, specify the execution time in 24-hour format, to the minute. The rule runs once a day. If you select Use cron expression, customize the schedule with a standard five-field Cron expression for more flexible scheduling.

Node type

Required. Select one node type to scale when the rule takes effect, such as Data Node. Refer to the options displayed on the page.

Node specifications

The specifications of the elastic nodes, determined by the current resource specifications of the instance. They cannot be changed in this dialog box.

Elastic resources (node count)

When the rule takes effect, the pay-as-you-go resource count for the selected node type is adjusted to this target value. For subscription instances, the range is 0 to 50. For pay-as-you-go instances, the lower limit is the minimum node count for that node type (1 for Data Node, 1 for Index Node, and 2 for Streaming Node), and the upper limit is 50. For high-availability instances deployed across two zones, the node count step size is 2.

Note

After the number of scaling rules for a node type reaches the limit of 10, you must delete some rules before you can create more.

Configuration examples

The following two rules configure daytime scale-out and nighttime scale-in for Data Node: scale out to 2 elastic nodes at 09:00 every day to handle write peaks, and scale in to 0 at 22:00 every day to release resources.

Parameter

Example 1: Daytime scale-out

Example 2: Nighttime scale-in

Rule name

day-scale-out

night-scale-in

Execution interval

Every day at 09:00

Every day at 22:00

Node type

Data Node

Data Node

Elastic resources (node count)

2

0

Manage scaling rules

After a rule is created, it appears in the Auto Scaling Rules (Scheduled) list. The list displays the rule's Rule ID / Name, Node Type, Target Resources and Schedule, and provides the following actions in the Actions column.

Edit a rule

  1. Find the target rule and click Edit.

  2. In the Edit dialog box, modify the parameters, and then click OK.

Note

The node type cannot be changed, but all other parameters can be adjusted. You cannot edit a rule while it is running.

Enable or disable a rule

You can enable or disable a rule to control whether it takes effect, without deleting it. Find the target rule and click Enable or Disable, and confirm in the confirmation dialog box.

Note

After a rule is disabled, it no longer triggers auto scaling activities. Completed scaling results are unaffected. You cannot change a rule's status while it is running.

Delete a rule

Find the target rule and click Delete, and confirm in the confirmation dialog box.

Note

After a rule is deleted, it no longer triggers auto scaling activities. Completed scaling results are unaffected. You cannot delete a rule while it is running.

Change the execution time zone

  1. On the Auto Scaling Configuration page, click Switch Time Zone.

  2. Select the target time zone and click Switch.

Note

You cannot change the time zone while scaling rules exist for the instance. Delete all scaling rules first.

View historical scaling activities

On the Auto Scaling tab, click Overview to view historical auto scaling records.

Field

Description

Rule name

The name of the rule that triggered the scaling activity.

Component type

The node type involved in the scaling activity.

Status

The execution status of the scaling activity, including pending, running, successful, failed, rejected, and canceled.

Start time, end time

The start and end times of the scaling activity.

Description

Details of the scaling activity, which can help identify the cause of a scaling failure.

FAQ

Does auto scaling affect running queries and writes?

Running queries and writes are not interrupted. Scale-out primarily involves allocating and initializing new nodes, which usually takes only a few minutes, after which the instance automatically rebalances data. Scale-in uses graceful decommissioning: the system first migrates data from the nodes to be removed to the remaining nodes, and releases node resources only after confirming data integrity. The migration time depends on the cluster workload. The default graceful decommissioning timeout is 1 hour, after which the system forcibly completes scale-in.

References