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.
- Log on to the ALB console.
- In the left-side navigation pane, click Health Check.
- On the Health Check page, click Create Health Check.
- Set the following parameters and click Create. When the system frequently attempts to retry a health check, the availability of your workloads may be affected. We recommend that you use default settings when you configure health checks.
Configuration item Description Name Enter a name for the health check. The reason must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. 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 available to receive requests.
Health Check Method Select a health check method. Valid values:
Note This parameter is effective only when HTTP is specified as the health check protocol.
- 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.
HTTP Version Select an HTTP version. Valid values: HTTP1.0 and HTTP1.1.Note This parameter is effective only when HTTP is specified as the health check protocol. Port Specify the ports that are probed by the health check.
By default, health checks probe the ports of backend servers. You can also specify a port for health checks. 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. ALB sends the requests by using the private IP address of the ECS instance. If you do not want to use the default homepage for health checks, you can specify another URL.
Domain Name Enter the domain name that is used for health checks.
By default, ALB uses the private IP addresses of backend servers as the domain names for health checks. You can also enter a domain name. The domain name must be 1 to 80 characters in length, and can contain only lowercase letters, digits, periods (.), and hyphens (-). The domain name must contain at least one period (.) but cannot start or end with a period (.).
Normal Status Codes Select one or more HTTP status codes. The specified HTTP status codes are used to indicate that health checks are normal. 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 the backend ECS instance does not send an expected response within the specified period of time, the ECS instance is considered 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.