Saturday, February 20, 2021

AWS ELB 504 error

Last couple of weeks, had trouble to resolve the mysterious occurrences of AWS ELB 504 errors in our product development.  Identification of root causes, is not straight forward and difficult to trace and debug the time out error in production.

In general, 504 Gateway Timeout is caused by the using the Elastic Load Balancer (ELB) address. When the ELB is unable to reach the underlying url of the request page during the short process-intensive period required for the database setup, the ELB serves the user a 504 error.

Our problem was not straight case with few challenges to understand.  Got a recent/relevant blog which is the exact match of our current production scenarios.  Recommended solution is that all relevant backend timeouts (not just explicit CF keepalive timeouts) must be larger than the ELB’s idle timeout.

Ref: https://sigopt.com/blog/the-case-of-the-mysterious-aws-elb-504-errors/

2 comments: