title: AWS Elastic Beanstalk 504 Gateway Timeout
body: <p>I have a Node server running on AWS Elastic Beanstalk. One of my endpoints accepts a huge payload and the function itself is pretty slow and lengthy, and can take upwards of 10+ minutes.</p>
  
  <p>Due to business requirements it must remain as a single HTTP POST and cannot be split up to be any smaller.</p>
  
  <p>On larger calls I am getting a 504 GATEWAY TIMEOUT, always around the 60 second mark. I have tried toying with the timeout settings in Elastic Beanstalk Load Balancer section to no avail, it seems the longest timeout duration is 60 second anyway.</p>
  
  <p>I did see one promising solution in the docs at <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html" rel="noreferrer">https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html</a></p>
  
  <blockquote>
    <p>To ensure that lengthy operations such as file uploads have time to complete, send at least 1 byte of data before each idle timeout period elapses</p>
  </blockquote>
  
  <p>This sounds like exactly what I need, but I do not know how to accomplish</p>
  
  <p><strong>1)</strong> How can I "send at least 1 byte of data" from my Node app to ensure the session is kept alive and doesn't timeout after one minutes</p>