Updated on 2026-09-04 GMT+08:00

Health Check

AS provides health check. A health check periodically checks the status of each instance in an AS group and automatically removes unhealthy instances from the group. Then, AS group adds new instances so that the number of instances is the same as the expected number. The health check methods of an AS group include ECS health check and ELB health check.

Constraints

  • Even when an AS group is disabled, AS still checks the health of instances in the AS group, but does not remove unhealthy instances.
  • AS does not check the health of instances in standby state.

Health Check Methods

A health check removes unhealthy instances from an AS group. Then, AS adds new instances to the AS group so that the number of instances is the same as the expected number. There are two types of AS group health checks.

  • ECS health check: checks the ECS instance status. If an ECS instance is stopped or deleted, it is considered unhealthy. ECS health check is the default health check method for an AS group. The AS group periodically uses the check result to determine the status of each ECS instance in the AS group. If an ECS instance is unhealthy, AS removes the ECS instance from the AS group.
  • ELB health check: determines the ECS instance status using a load balancing listener. If the AS group uses load balancers, the health check method can also be ELB health check. For more information about ELB health check, see Elastic Load Balance Health Checks.

    If you add multiple load balancers to an AS group, an ECS instance is considered healthy only when all load balancers detect that the ECS instance is healthy. If any load balancer detects that an ECS instance is unhealthy, the ECS instance will be removed from the AS group.

In both the ECS health check and ELB health check methods, AS removes unhealthy ECS instances from the AS group. Whether a removed ECS instance will be deleted depends on how the instance was added to the AS group.

Table 1 Instance removal and deletion rules

Instance Type

Description

Billing Mode

Removed If Unhealthy

Deleted When Removed

Automatically added instances

Instances automatically created and added to an AS group in a scaling action

Pay-per-use or spot pricing

By default, instances automatically added in a scaling action are billed on a pay-per-use basis.

Yes

Yes

Yearly/Monthly

The billing mode of an automatically added instance can be manually changed from pay-per-use to yearly/monthly.

Yes

No

Manually added instances

Instances manually created and added to an AS group

Pay-per-use or spot pricing

Yes

No

Yearly/Monthly

Yes

No

If you need to perform some operations on the instance that is being deleted or created, you can use lifecycle hooks. For details, see Lifecycle Hooks.

Related Information

By default, health check is enabled for scaling groups. If load balancing is not used, only the ECS health check can be used. After ELB is enabled for an AS group, the ELB health check is enabled by default. In this case, you can still use the ECS health check, but the ELB health check is recommended. The health check interval and grace period (seconds) can be configured.

  • Health Check Interval: indicates the health check period for an AS group. The default value is 5 minutes, indicating that the system checks the instance status every 5 minutes.
  • Health Check Grace Period (s): Generally, instances automatically added in a scaling action require enough warm-up time to pass the ELB health check. The health check grace period starts only after an instance is added to an AS group and enabled. The AS group will start checking the instance status only after the grace period ends. The default value is 600s.