DVA-C02 Question 343
Single answerYour application running on Amazon EC2 instances behind an Application Load Balancer (ALB) is returning an HTTP 504 error to clients during peak traffic hours. What could be the most likely reason for this error?
- A
The client sent a request with a malformed URL.
- B
The server is taking too long to respond to the request.
- C
The requested resource does not exist on the server.
- D
The application is experiencing a permissions issue when accessing an S3 bucket.
Show answer and explanation
Correct answer: B
Explanation
An HTTP 504 Gateway Timeout error occurs when a server acting as a gateway (e.g., an Application Load Balancer) does not receive a timely response from an upstream server (e.g., the application server running on EC2). This is commonly caused by performance bottlenecks or an overload on the backend servers during peak traffic. Therefore, the most likely reason in this scenario is that the server is taking too long to respond to the request.
- A. Incorrect.
A malformed URL typically results in an HTTP 400 (Bad Request) error, not an HTTP 504.
- B. Correct.
An HTTP 504 error indicates a Gateway Timeout, which occurs when the server behind the load balancer takes too long to respond to a request.
- C. Incorrect.
If the requested resource does not exist, the server would return an HTTP 404 (Not Found) error, not an HTTP 504.
- D. Incorrect.
A permissions issue with an S3 bucket would typically result in an HTTP 403 (Forbidden) error, not an HTTP 504.