AWS Elastic Load Balancer
As the first gateway between your users and your application, load balancers are a critical piece of any scalable infrastructure.
If it is not working properly, your users can experience much slower application response times or even outright errors, which can lead to lost transactions for example.
If a 504 error (Gateway Timeout) is returned, the response time exceeded ELB’s idle timeout. Default timeout is 60secs (now aws supports 1s-60mins)
You can confirm it by checking if latency is high and 5xx errors are returned by ELB. In that case, consider scaling up your backend, tuning it, or increasing the idle timeout to support slow operations such as file uploads. If your instances are closing connections with ELB, you should enable keep-alive with a timeout higher than the ELB idle timeout.
Latency: This metric measures your application latency due to request processing by your backend instances, not latency from the load balancer itself. Tracking backend latency gives you good insight on your application performance. If it’s high, requests might be dropped due to timeouts, which can lead to frustrated users. High latency can be caused by network issues, overloaded backend hosts, or non-optimized configuration (enabling keep-alive can help reduce latency for example).