Updated on 2024-04-19 GMT+08:00

Modifying Health Check Settings

Scenario

This section describes how you can modify the health check settings.

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.

Constraints and Notes

  • 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.

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. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balance.
  4. In the navigation pane on the left, choose Elastic Load Balance > Backend Server Groups.
  5. On the Backend Server Groups tab page, locate the backend server group.
  6. On the Summary page, click Health Check on the right.
  7. In the Configure Health Check dialog box, configure the parameters based on Table 1.
    Table 1 Parameters required for configuring health check

    Parameter

    Description

    Example Value

    Health Check

    Specifies whether to enable health checks.

    -

    Health Check Protocol

    • The health check protocol can be TCP, HTTP, or HTTPS.
    • If the protocol of the backend server group is UDP, the health check protocol is UDP by default.

    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 or HTTPS.

    • 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.

    www.elb.com

    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.

    80

    Interval (s)

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

    The interval ranges from 1 to 50.

    5

    Timeout (s)

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

    3

    Maximum Retries

    Specifies the maximum number of health check retries. The value ranges from 1 to 10.

    3

  8. Click OK.

Disabling Health Check

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Network > Elastic Load Balance.
  4. In the navigation pane on the left, choose Elastic Load Balance > Backend Server Groups.
  5. On the Backend Server Groups page, click the name of the target backend server group.
  6. On the Summary page, click Health Check on the right.
  7. In the Configure Health Check dialog box, disable health check.
  8. Click OK.