Marked as helpful by the asker
That's a cold start: the platform scales your service to zero when idle and boots it on the first request. Options, cheapest first:
- A free uptime monitor pinging
/healthevery 5 minutes keeps it warm. Free, slightly ugly. - Turn off scale-to-zero ("always on") in Railway, costs a few euros a month.
- Make startup faster: lazy-load heavy imports (pandas, torch) inside the endpoint that needs them instead of at module level.
Do 3 anyway, it's the real fix.