R
Railwayβ€’8mo ago
Mike πŸ¦‘

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
Percy
Percyβ€’8mo ago
Project ID: a321c36a-8bf1-4eba-b44d-d026fff6a67b
Brody
Brodyβ€’8mo ago
is this a post request?
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
a321c36a-8bf1-4eba-b44d-d026fff6a67b Yep
Brody
Brodyβ€’8mo ago
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)
Brody
Brodyβ€’8mo ago
No description
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
damn, okay thanks for testing so strange....i could run them last time i tested and when i run local, post reqs are fine
Brody
Brodyβ€’8mo ago
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.
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
ah okay, thanks Brody πŸ™ i'll try a fresh deploy from scratch
Brody
Brodyβ€’8mo ago
without any config changes i dont know how much that would do to solve this, but the good 'ol reboot cant hurt
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
yep fresh install has same problem - must be config 🫠
Brody
Brodyβ€’8mo ago
maybe hypercorn changed some defaults?
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
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
Brody
Brodyβ€’8mo ago
im sorry but if it was a railway issue i would be able to replicate it here
Mike πŸ¦‘
Mike πŸ¦‘β€’8mo ago
would it have something to do with nginx? can i change the config on railway? all other settings look fine in hypercorn :/
Brody
Brodyβ€’8mo ago
railway doesnt use nginx
Want results from more Discord servers?
Add your server