504 (Gateway Timeout) on AWS

15,331

ELB by default times out at 60 seconds; there is no way I know of to extend this limit, although this page suggests that it's something Amazon Support can do for you (and also suggests a method of working around the problem):

Point 6) Amazon ELB timeouts at 60 seconds (kept idle)

Amazon ELB currently timeouts persistent socket connections @ 60 seconds if it is kept idle. This condition will be a problem for use cases which generates large files (PDF, reports etc) at backend EC2, sends them as response back and keeps connection idle during entire generation process. To avoid this you'll have to send something on the socket every 40 or so seconds to keep the connection active in Amazon ELB. Note: I heard we can extend this value after explaining the case to AWS support team.

Edit: As commenters below have pointed out, as of July 24th, 2014 this is configurable in your AWS console.

Share:
15,331
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I have my web app running on AWS EC2 instance in PHP and I make an ajax call that takes about 5-10 mintes, I see the web console in Google Chrome and I get this 504 (Gateway Timeout) ,How I can increase the value of this, is that related to apache? Thanks