Updated on 2024-11-14 GMT+08:00

Enabling or Disabling Health Check

Scenarios

This section describes how you can enable or disable the health check option.

After the protocol is changed, the load balancer uses the new protocol to check the health of backend servers. The load balancer continues to route traffic to the backend servers after they are detected healthy.

Before the new configurations take effect, the load balancer may return the HTTP 503 error code to the clients.

Notes and Constraints

  • The health check protocol can be different from the backend protocol.
  • To reduce the vCPU usage of the backend servers, it is recommended that you use TCP for health checks. If you want to use HTTP for health checks, you can use static files to return the health check results.
  • If health check is enabled, security group rules must allow traffic from the health check port to the backend servers over the health check protocol. For details, see Security Group and Network ACL Rules.

After you enable health check, the load balancer immediately checks the health of backend servers.

  • If a backend server is detected healthy, the load balancer will start routing requests to it over new connections based on the configured loading balancing algorithms and weights.
  • If a backend server is detected unhealthy, the load balancer will stop routing traffic to it.

Enabling Health Check

  1. Go to the backend server group list page.
  2. On the Backend Server Groups page, locate the backend server group and click its name.
  3. On the Summary page, click Health Check on the right.
  4. In the Configure Health Check dialog box, configure the parameters based on Table 1.
    Table 1 Parameters required for configuring health check

    Parameter

    Description

    Health Check

    Specifies whether to enable health checks.

    NOTE:

    When the health check is enabled or disabled, the number of healthy or unhealthy backend servers may temporarily fluctuate but will stabilize after a monitoring period.

    Health Check Protocol

    Specifies the protocol that will be used by the load balancer to check the health of backend servers.

    If the protocol of the backend server group is UDP, the health check protocol is UDP by default.

    Shared load balancers support TCP and HTTP.

    Domain Name

    Specifies the domain name that will be used for health checks. This parameter is mandatory if the health check protocol is HTTP.

    • You can use the private IP address of the backend server as the domain name.
    • You can also specify a domain name that consists of at least two labels separated by periods (.). Use only letters, digits, and hyphens (-). Do not start or end strings with a hyphen. Max total: 100 characters. Max label: 63 characters.

    Health Check Port

    Specifies the port that will be used by the load balancer to check the health of backend servers. The port number ranges from 1 to 65535.

    NOTE:

    By default, the service port on each backend server is used. You can also specify a port for health checks.

    Path

    Specifies the health check URL, which is the destination on backend servers for health checks. This parameter is mandatory if the health check protocol is HTTP. The path can contain 1 to 80 characters and must start with a slash (/).

    If the backend server group is associated with a shared load balancer, the path can contain letters, digits, hyphens (-), slashes (/), periods (.), question marks (?), percent signs (%), ampersands (&), and underscores (_).

    Interval (s)

    Specifies the maximum time between two consecutive health checks, in seconds.

    The interval ranges from 1 to 50.

    Timeout (s)

    Specifies the maximum time required for waiting for a response from the health check, in seconds. The value ranges from 1 to 50.

    Healthy Threshold

    Specifies the number of consecutive successful health checks required for declaring a backend server healthy. The value ranges from 1 to 10.

    Unhealthy Threshold

    Specifies the number of consecutive failed health checks required for declaring a backend server unhealthy. The value ranges from 1 to 10.

  5. Click OK.

Disabling Health Check

  1. Go to the backend server group list page.
  2. On the Backend Server Groups page, click the name of the target backend server group.
  3. On the Summary page, click Health Check on the right.
  4. In the Configure Health Check dialog box, disable health check.
  5. Click OK.