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.


  1. brillant piece of information, I had come to know about your web-page from my friend hardkik, chennai,i have read atleast 9 posts of yours by now, and let me tell you, your webpage gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanx a million once again, Regards
    aws training in hyderabad


Post a Comment

Popular posts from this blog

AWS RDS incompatible-parameters solved