A company runs a critical application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application experiences intermittent errors where some requests return HTTP 503 (Service Unavailable) errors. The developers have verified that the application code is healthy and the EC2 instances pass health checks. The ALB health check is configured to hit a specific endpoint (/health) with a healthy threshold of 2 and an unhealthy threshold of 2. The health check interval is 30 seconds, and the timeout is 5 seconds. The application's /health endpoint sometimes takes up to 6 seconds to respond due to a dependency on a third-party service. The developers want to minimize the 503 errors without changing the application code. Which action should the developer take?
Prevents false negatives due to slow responses.
Why this answer
The correct action is to increase the health check timeout from 5 seconds to 10 seconds. Since the /health endpoint sometimes takes up to 6 seconds to respond, the current timeout of 5 seconds causes the ALB to consider the instance unhealthy, leading to 503 errors. By increasing the timeout, the ALB will wait longer for a response, reducing unnecessary health check failures.
Option B is wrong because decreasing the unhealthy threshold would make instances even more sensitive, increasing 503 errors. Option C is wrong because deregistration delay affects connection draining during instance termination, not health check behavior. Option D is wrong because decreasing the health check interval does not help; the issue is timeout, not frequency.