FastAPI + Hypercorn dropping connection after 60 seconds
Hey I'm running a FastAPI with hypercorn. Everything was fine last month, now encountering server dropping requests after 60 seconds.
Remote end closed connection without response
keep-alive
is 120 seconds with hypercorn. runs as expected locally but disconnects on railway after 60 seconds.
any thoughts?31 Replies
Project ID:
a321c36a-8bf1-4eba-b44d-d026fff6a67b
is this a post request?
a321c36a-8bf1-4eba-b44d-d026fff6a67b
Yep
just tested a long lived post request, got well over 60 seconds, this would be a config issue with fastapi/hypercorn.
does hypercorn provide a way to configure the max request time? (keep-alive isnt the same thing)
![No description](https://cdn.answeroverflow.com/1195243160813707284/image.png)
damn, okay thanks for testing
so strange....i could run them last time i tested
and when i run local, post reqs are fine
definitely strange but not a railway issue as shown above, if you would like to test yourself, post to https://utilities.up.railway.app/upload?slimit=0.25
i will note that railway does have a 5 minute max request time for post requests.
ah okay, thanks Brody π
i'll try a fresh deploy from scratch
without any config changes i dont know how much that would do to solve this, but the good 'ol reboot cant hurt
yep fresh install has same problem - must be config π«
maybe hypercorn changed some defaults?
hmm now even tried migrating to gunicorn and uvicorn and still same issue...
this feels like an SSL / Railway issue. Still works fine on localhost
im sorry but if it was a railway issue i would be able to replicate it here
would it have something to do with nginx? can i change the config on railway? all other settings look fine in hypercorn :/
railway doesnt use nginx