Global Accelerator (GA) uses health checks to determine the health status of endpoints. This mechanism improves service reliability and availability by preventing traffic from being routed to unhealthy endpoints.
Introduction to health checks
You can enable health checks for the endpoint groups of your GA instance. When an endpoint fails a health check, GA automatically redirects new requests to other healthy endpoints. After an unhealthy endpoint recovers and passes health checks, GA automatically resumes routing traffic to it.
GA supports health checks over TCP, HTTP, and HTTPS.
TCP health checks
TCP health checks operate at the transport layer. The service sends a SYN handshake packet to probe whether the server port is active. The process is as follows:
Step | Description |
① | Using the listener's health check configuration, the GA instance sends a TCP SYN packet to the IP address and health check port of the endpoint. |
② | The outcome of the health check is determined by whether the endpoint returns a SYN+ACK packet.
Note The response timeout is the maximum time to wait for a response to a health check probe. If an endpoint does not respond correctly within this period, the health check fails. The system default is 3 seconds and cannot be changed. |
③ | After the GA instance receives the SYN+ACK packet, it sends an ACK packet to the endpoint to complete the TCP handshake. |
HTTP and HTTPS health checks
HTTP and HTTPS health checks use GET requests to simulate browser access and check the health of the backend service application on the endpoint. The process is as follows:
Step | Description |
① | Using the listener's health check configuration, the GA instance sends an HTTP GET request to the IP address, health check port, and health check path of the endpoint. |
② | After the endpoint receives the request, it returns an HTTP status code based on the health of the service.
Note The response timeout is the maximum time to wait for a response to a health check probe. If an endpoint does not respond correctly within this period, the health check fails. The system default is 3 seconds and cannot be changed. |
Health check time window
Health checks improve service availability. However, to prevent system instability caused by frequent state changes, GA changes an endpoint's health status only after it consecutively passes or fails a set number of health checks. This period is called the health check time window. The following factors determine the time window:
health check interval: The time between two consecutive health check probes.
response timeout: The maximum time to wait for a health check response from a backend service.
healthy threshold: The number of consecutive successful or failed health checks required to change the health status of an endpoint.
The health check time window is calculated as follows:
Health check failure time window = response timeout × healthy threshold + health check interval × (healthy threshold - 1)
For example, as shown in the following figure, if the response timeout is 3 seconds, the health check interval is 2 seconds, and the healthy threshold is 3, the time window to declare an endpoint unhealthy is 3 × 3 + 2 × (3 - 1) = 13 seconds.
Health check success time window = (health check success response time × healthy threshold) + health check interval × (healthy threshold - 1)
For example, as shown in the following figure, if the successful response time is 1 second, the health check interval is 2 seconds, and the healthy threshold is 3, the time window to declare an endpoint healthy is 1 × 3 + 2 × (3 - 1) = 7 seconds.
Limitations
For UDP listeners, health checks are supported only if the endpoint runs a service over TCP, HTTP, or HTTPS. Otherwise, GA always marks the endpoint as unhealthy.
Enable health checks
Log on to the GA console.
On the Instances, find the GA instance and click Configure Listeners in its Actions column.
On the Listeners tab, find the listener that you want to manage and click Edit in the Actions column.
On the Edit Listener page, click Next.
In the Health Check section of the Configure Endpoint Group wizard page, turn on the Health Check switch and configure the following parameters.
Parameter
Description
Health Check Protocol
The protocol used for health checks. Valid values: TCP, HTTP, and HTTPS.
TCP: sends SYN handshake packets to probe whether the server port is active.
HTTP and HTTPS: send GET requests to simulate browser access and check the health of the backend service application.
Port
The port used to perform health checks on endpoints.
Valid values: 1 to 65535.
Health Check Domain Name
The domain name for health checks. This feature is supported only by pay-as-you-go GA instances.
Endpoint IP Address (default): Uses the IP address of the endpoint as the domain name for health checks.
Custom Domain Name: Enter a specific domain name.
Health Check Interval
The interval between two consecutive health check probes.
Valid values: 1 to 50. Unit: seconds. Default value: 2.
URI
The path for health checks. This parameter is available only when Health Check Protocol is set to HTTP or HTTPS.
The path must be 1 to 80 characters long and start with a forward slash (/). It can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), ampersands (&), and the extended character set
_;~!()*[]@$^:',+.By default, GA sends a GET request to the default home page of the backend service application. If the page used for health checks is not the default home page, you must specify a path.
Healthy Threshold
The number of consecutive successful or failed health checks required to change the health status of an endpoint.
Valid values: 2 to 10. Default value: 3.
Click Next. On the Configuration Review wizard page, confirm the settings and click Submit.
Additional operations
Actions | Description |
Modify health check settings |
|
Disable health checks |
|
References
CreateEndpointGroup: Creates an endpoint group. You can configure health checks when you create an endpoint group.
UpdateEndpointGroup: Updates the configuration of an endpoint group. You can configure health checks when you update an endpoint group.
GetHealthStatus: Queries the health status of an endpoint.