What is a cold start — and why your first visitor waits the longest

You deploy your app, send the link to a friend, and they reply: "it's hanging." You open it a minute later — instant. You open it next morning — hanging again, ten seconds this time.
Looks like a flaky bug. It's a cold start, and it works exactly as designed.
Here's the trick: your site wasn't slow at that moment. It wasn't there. At all.
A cold start isn't a slow server — it's a missing one
Modern hosts don't keep your code running around the clock. No requests, no process: the container is shut down, the memory is freed, the machine goes to someone else.
Then the first visitor shows up, and everything is rebuilt:
- the image with your code is pulled,
- the runtime boots (Node, Python — whatever you use),
- the once-per-start work runs: connecting to the database, reading config, warming a cache,
- and only now do you get an answer.
That's a cold start. Warm is when the container is already up and just replies.
Modal, a serverless compute platform, splits that delay in two in its own docs: your request waits for a warm container to free up or boot, and then pays again for first-call initialization. Two different problems with two different fixes — keep them separate when you debug your own project.
Why free hosting "falls asleep"
That's not greed, it's an honest trade. A free tier can't keep your process alive forever — otherwise one side project with zero traffic would hold memory for years.
So free plans almost always sleep after idle: nobody called, so it's off. Hence the classic complaint "in the morning my site takes forever, in the afternoon it's fine" — in the morning you're the first one, by afternoon someone else already woke it up.
Same mechanism inside serverless — there the platform never promises your function survives between calls.
For AI models, the cold start is a whole different scale
An ordinary function boots in a fraction of a second — reading a few megabytes of code is fast.
Now picture booting a model. Its weights are tens of gigabytes, and they don't just need downloading — they need loading into GPU memory. Here you hit physics, not code: you can't argue with transfer speed.
Modal's engineers wrote in May 2026 that naively spinning up a server with a large model on a fresh GPU can take tens of minutes — and sometimes stall for hours waiting for a free card at all. Their own engineering (a buffer of warm GPUs, lazy image loading, restoring a process from a memory snapshot) brought that down to tens of seconds.
Which gives you one practical takeaway that saves a lot of confusion: if you call an AI model through a service like Replicate and see "sometimes 2 seconds, sometimes 40" — that's not the network. A popular model at that provider is warm, because other people keep calling it. Your rare one is cold, and it gets booted just for you.
How it's fixed — and what it costs
There's no universal "turn cold starts off." There are four trades:
- A paid plan with no sleep. The honest one: you pay for the process to always be alive. That's how most hosts work.
- A warm pool. The provider keeps started instances on standby. On serverless GPUs it's a separate paid option — you're essentially renting idle time.
- Less work at startup. Don't do at boot what can be done lazily: heavy imports, cache warming, migration checks. Often half of those "cold" seconds are your own init code, not the platform.
- Hide the wait. Show a page skeleton and an honest "waking up" state instead of a white screen. The wait doesn't vanish, but it stops reading as a breakage.
As for the popular advice "ping your own site every 10 minutes so it never sleeps" — that's a hack. It burns someone else's resources, plenty of hosts explicitly forbid it, and it won't save you from the post-deploy start anyway. If the project matters, pay for a living process.
What this means for you
Ask yourself who your first visitor is.
A side project, a portfolio, a demo for friends — a cold start is fine. A couple of seconds once a day breaks nobody's day, and free hosting saves real money.
A signup form, a payment, a bot that must answer instantly — not fine. Here the wait converts straight into a user who left, and the price gap between plans is cheaper than one lost lead.
And keep the main idea: a cold start isn't about bad code or slow network latency. It's about someone paying for the readiness to answer at any second. Either you pay in money, or your first user pays in seconds.
Can I measure a cold start?
Yes, and it's the first thing to do. Open the app after a long idle period, time the first response, then reload immediately and time the second. The gap between them is the price of the start — and if there's no gap, something else is slow.
Why is the first request after a deploy slow too?
Because a new version means a new container: the old one is off, the fresh one has never run. Every deploy guarantees exactly one cold start, even on a paid plan.
Is this the same as "my bot stops when I close my laptop"?
No, that one has a different cause — the process lived on your machine and died with it. There's a separate breakdown of that, and the fix is moving to a host, not changing a plan.
The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.





