I'm building a web app using Flask and hosting it on Heroku. My app scrapes the web—so it can take anywhere from a few seconds to 20 minutes, depending on the search criteria. When I try to run bigger requests, the application times out after the default 30 seconds. Does anyone know how to increase the timeout length? I've tried changing the Profile from this:
web: gunicorn myapp:app --log-file=-
to this:
web: gunicorn myapp:app --timeout 1200
but got nowhere.
But when I changed it to
web: gunicorn myapp:app --timeout 5
it timed out at 5 seconds
Heroku has a limit of 30 sec
for any request to complete. If the request takes more than 30s
then it leads to H12 error
.
So, in your case you can't set
web: gunicorn myapp:app --timeout 1200
Ref: https://devcenter.heroku.com/articles/python-gunicorn#worker-timeouts and https://devcenter.heroku.com/articles/limits#http-timeouts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With