This topic describes how to configure health checks to monitor the conditions of server groups. This helps you evaluate the availability of the backend servers in the server groups.

Background information

Application Load Balancer (ALB) instances distribute requests only to healthy backend servers in active zones. If a backend server is declared unhealthy, the ALB instance stops forwarding requests to the backend server, and distributes subsequent requests to other healthy backend servers. The ALB instance starts to distribute requests to the unhealthy backend server only after the unhealthy backend server recovers. Each backend server must pass at least one health check before the backend server can be declared healthy. After ALB completes a health check, the connection that is established to perform the health check is closed.

Procedure

  1. Log on to the Server Load Balancer console.
  2. In the left-side navigation pane, choose ALB > Health Check.
  3. On the Health Check page, click Create Health Check.
  4. Configure the health check parameters and click Create.
    When the system attempts to retry a health check frequently, the availability of your workloads may be affected. We recommend that you use default settings when you configure health checks.
    Parameter Description
    Name Enter a name for the health check. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.
    Health Check Protocol Select the protocol of the health check. Valid values:
    • HTTP: To perform HTTP health checks, ALB sends HEAD or GET requests to a backend server to check whether the backend server is healthy.
    • TCP: To perform TCP health checks, ALB sends SYN packets to a backend server to check whether the port of the backend server is open.
    Health Check Method Select a method for the health check. Valid values: HEAD and GET.
    • HEAD: By default, HTTP health checks use the HEAD method. Make sure that your backend servers support HEAD requests. If your backend server does not support the HEAD method or the HEAD method is disabled, the health check may fail. In this case, you can use the GET method.
    • GET: If the length of a response exceeds 8 Kb, the response is truncated. However, the health check result is not affected.
    Note This parameter is effective only when HTTP is specified as the health check protocol.
    HTTP Version Select an HTTP version. You can select HTTP1.0 or HTTP1.1.
    Note This parameter is effective only when HTTP is specified as the health check protocol.
    Port Select the port that is probed to check whether a backend server is healthy.
    • Use the ports of backend servers: By default, the ports of backend servers are probed.
    • Specify a port: Manually specify the port to be probed. Valid values: 1 to 65535.
    Path Enter the URL of the web page that is requested by health checks. We recommend that you enter the URL of a static web page. The URL must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

    By default, to perform health checks, ALB sends HTTP HEAD requests to the default homepage configured on a backend Elastic Compute Service (ECS) instance through the private IP address of the ECS instance. If you do not want to use the default homepage for health checks, you can manually specify a URL.

    Domain Name Optional. Enter a domain name for the health check.
    • Use the private IP addresses of backend servers (default): By default, the private IP addresses of backend servers are used for health checks.
    • Specify a domain name: Enter a domain name. The domain name must be 1 to 80 characters in length. It can contain only lowercase letters, digits, periods (.), and hyphens (-). The domain name must contain at least one period (.). The domain name cannot start or end with a period (.).
    Normal Status Code Select the HTTP status code that indicates a successful health check. Valid values: http_2xx (default), http_3xx, http_4xx and http_5xx.
    Note This parameter is effective only when HTTP is specified as the health check protocol.
    Response Timeout Period Specify the timeout period for a health check response. If a backend ECS instance does not return an expected response within the specified period of time, the backend server is declared unhealthy.

    Valid values: 1 to 300. Default value: 5. Unit: seconds.

    Health Check Interval Specify the interval between two consecutive health checks.

    Valid values: 1 to 50. Default value: 2. Unit: seconds.

    Healthy Threshold Specify the number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.

    Valid values: 2 to 10. Default value: 3.

    Unhealthy Threshold Specify the number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.

    Valid values: 2 to 10. Default value: 3.