Hitting 503 on Cold Boot \ Serverless | App launchs ~1 sec
urish11
PROOP

7 months ago

Hey,

I’m seeing 503s on the very first request after a cold boot, even though the python FastAPI app itself launches in about ~1 second. Once it’s warm, everything works fine.

Logs look like this:

Aug 23 14:15:26 Starting Container
Aug 23 14:15:27 INFO:     Waiting for application startup.
Aug 23 14:15:27 INFO:     Application startup complete.
Aug 23 14:15:27 INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

Then the first external request hits → 502. Any requests after that are fine.

Could you check why the proxy is throwing 502s on the first cold hit?

I have a Healthcheck Path setup, if it makes any difference...

Solved

2 Replies

7 months ago

Hey, this issue has been fixed a long time ago if I remember it correctly. I'll escalate this to the team to potentially find out the reason for why the first request is responding 502 after being waken up from sleep. For now, I would recommend to turn off serverless, if the frequent 502 responses interrupt your applications' workflow.


7 months ago

Do you have health checks set up?

https://docs.railway.com/reference/healthchecks

This will prevent us from removing your old deployment and switching traffic over to the deployment that isn't ready yet, until you tell us it is (via the healthcheck)


Status changed to Awaiting User Response Railway 7 months ago


Railway
BOT

6 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 6 months ago


Loading...