Overview
ELB periodically sends requests to associated backend servers to check their health. This is the health check process, through which ELB decides whether backend servers are able to process requests. If a backend server is detected as unhealthy, the load balancer stops routing requests to it, ensuring service reliability. After the backend server recovers, the load balancer will resume routing requests to it.
If backend servers have to handle large number of requests, frequent health checks may overload the backend servers and cause them to respond slowly. In this case, it is recommended that you prolong the health check interval or use TCP or UDP instead of HTTP. If you choose to disable the health check function, requests may be routed to unhealthy servers, and service interruptions may occur.
Prerequisites
If HTTP is used for health checks, ensure that HTTP/1.1 is used for TCP or UDP listeners of both types of load balancers as well as HTTP or HTTPS listeners of shared load balancers, and that HTTP/1.0 is used for HTTP or HTTPS listeners of dedicated load balancers.
TCP Health Check
For TCP, HTTP, and HTTPS listeners, you can use TCP for health checks to obtain backend server statuses by initiating three-way TCP handshakes.
The TCP health check process is as follows:
- The ELB node that performs health checks sends an SYN packet to the backend server (private IP address+health check port) based on the health check configuration.
- After the backend server receives the packet, it returns an SYN-ACK packet over its port.
- If the ELB node does not receive the SYN-ACK packet within the health check timeout duration, the backend server is declared unhealthy. Then, the ELB node sends an RST packet to the backend server to terminate the TCP connection.
- If the ELB node receives the SYN-ACK packet from the backend server within the health check timeout duration, it sends an ACK packet to the backend server and declares that the backend server is healthy. After that, the ELB node sends an RST packet to the backend server to terminate the TCP connection.
After a normal TCP three-way handshake, data transfer starts. However, an RST packet will be sent to close the TCP connection during the health check. The applications on the backend server may consider this as a connection error and send a message, for example, "Connection reset by peer". Select either of the following operations:
- Configure an HTTP health check.
- Have the backend server ignore the connection error.
UDP Health Check
For UDP listeners, UDP is used for health checks by default, and UDP probe packets are sent to backend servers to obtain their health results.
The UDP health check process is as follows:
- The ELB node sends an ICMP Echo Request packet to the backend server based on the health check configuration.
- If the ELB node does not receive an ICMP Echo Reply packet within the health check timeout duration, the backend server is declared unhealthy.
- If the ELB node receives an ICMP Echo Reply packet within the health check timeout duration, it sends a UDP probe packet to the backend server.
- If the ELB node does not receive an ICMP Port Unreachable error within the health check timeout duration, the backend server is declared healthy. If the ELB node receives an ICMP Port Unreachable error, the backend server is declared unhealthy.
HTTP Health Check
You can also configure HTTP health checks to obtain server health results through HTTP GET requests if you select TCP, HTTP, or HTTPS as the frontend protocol. For HTTPS listeners, load balancers use HTTP to communicate with backend servers because of SSL/TLS offloading, and the health check protocol is HTTP by default.
The HTTP health check process is as follows:
- The ELB node sends an HTTP GET request to the backend server (in format of Private IP address:Health check port/Health check path) based on the health check configuration. When configuring the health check, you can set a domain name.
- After receiving the request, the backend server returns an HTTP status code to the ELB node.
- If the ELB node receives the status code within the health check timeout duration, it compares the status code with the preset status code. If the status codes are the same, the backend server is declared healthy.
- If the ELB node does not receive any response from the backend server within the health check timeout duration, the backend server is declared unhealthy.
Health Check Time Window
Health checks greatly improve service availability. To avoid the impact of frequent health checks on backend servers, you can disable health checks after several consecutive health checks that declare backend servers healthy or unhealthy.
Take shared load balancers as an example. The health check time window is determined by the following factors:
- Interval: indicates how often health checks are performed.
- Timeout: indicates how long the load balancer waits for the response from the backend server.
- Maximum retries: indicates the maximum number of consecutive health checks after which the backend servers are declared healthy.
Backend servers can be declared unhealthy after three consecutive health checks that detect these backend servers are unhealthy, regardless of the value set for Maximum Retries.
The following is a formula for you to calculate the health check time window:
- Time window for health checks that consider backend servers healthy = Timeout x Maximum retries + Interval x (Maximum retries – 1)
- Time window health checks that consider backend servers unhealthy = Timeout x 3 + Interval x (3 – 1)
Figure 4 shows an example.
- Interval: 4s
- Timeout: 2s
Rectifying an Unhealthy Backend Server
If a backend server is detected unhealthy, see How Do I Troubleshoot an Unhealthy Backend Server?
Last Article: Health Check
Next Article: Configuring a Health Check

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.