504 Gateway Timeout on Amazon AWS ELB (Elastic Load Balancer)

Faced it recently!!

The Client request is sending large data set to Server. Till date it worked fine on our Test & Staging servers. Put it on Live, and Kaput!!

Checked it across various clients, i.e. iOS, Android, Postman etc. Worked on all, but iOS. Increased time outs for Live to check, but still the same.

Eventually figured, Amazon ELB (Load Balancer) is timing out. ELB's idle timeout was 60 seconds. Increased it to 180 seconds, and Voila! it worked.

Load Balancers are nifty machines to help with keeping one address for outside world, and contain multiple sub addresses internally. ELB accepts the HTTP/HTTPs request which contains the large data set, and maintain a connection with the Client (along with a connection with Server). If client / instance does not send data in the duration specified in idle_timeout, the connection is closed by ELB.


Popular posts from this blog

AWS RDS incompatible-parameters solved

Solved "PHP Fatal error: Call to undefined function mysql_connect()"