Reputation: 777
We have an elasticbeanstalk application that runs an api. Now the requests to the API frequently expected to take tens of seconds to be satisfied. I used to get an http 504 Gateway_Timeout for the requests after 60s of sending the requests.
So I set the 'Idle timeout' of the load balancer to 1800s.
Now I get an http 502 Proxy Error after 60s:
How do I fix it so that even if requests take longer than 60s I do not get an http 500 error?
Any advise is appreciated. Thank you.
Upvotes: 2
Views: 1053
Reputation: 777
Some more links in addition to the accepted answer: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-proxy.html#java-tomcat-proxy-apache
Where to add .ebextensions in a WAR?
https://httpd.apache.org/docs/2.4/mod/core.html#timeout
Upvotes: 1
Reputation: 3254
I suspect it is not the elastic load balancer at all, but the HTTP server that resides in the container of the elastic beanstalk environment.
You need to configure the timeout of this server. This can usually be done with ".ebextensions" files. You can essentially replace the default httpd file with your own custom file using this method.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html
Upvotes: 1