{"head":{"title":"What Is a Cold Start in Serverless? Definition | OceanLab","description":"A cold start is the extra delay when a serverless function or new instance has to boot before handling a request. Why it happens, an example and fixes.","canonical":"https://oceanlab.in/glossary/cold-start"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"cold start","path":"/glossary/cold-start"}],"slug":"cold-start","term":"Cold start","aka":[],"category":"Hosting and delivery","short":"The extra delay when a serverless function or a new server instance has to start up before it can handle a request.","body":[[{"href":"/glossary/serverless","text":"Serverless"}," platforms shut down idle instances. When a request arrives and no warm instance is ready, the platform has to start one: load the runtime, your code and its dependencies, and open connections. That first request waits. Later requests on the same instance are warm and fast."],["Cold starts depend on the runtime, the size of the code bundle, how much work runs at startup and the platform. ",{"href":"/glossary/edge-function","text":"Edge functions"}," on lightweight runtimes usually start faster than full server runtimes."]],"why":["Cold starts hit the least used parts of an app hardest, and they often land on the first request a user makes. For user-facing APIs they can make an app feel slow even when average numbers look fine."],"example":["A booking API on serverless functions responds quickly most of the time, but the first booking after a quiet night is slow. The bundle is trimmed, a heavy SDK is loaded only when needed, and the busiest function is kept warm."],"inBuild":["We keep function bundles small, move heavy setup out of the hot path, reuse connections through ",{"href":"/glossary/connection-pooling","text":"connection pooling"}," and measure cold starts separately in ",{"href":"/glossary/apm","text":"APM"},". Where steady low latency matters more than idle cost, we run that part on always-on containers."],"mistakes":[["Opening a new database connection on every cold start, which can exhaust the database."],["Bundling the whole codebase into every function."],["Judging performance by averages that hide the slow first requests."]],"related":[{"href":"/glossary/serverless","label":"Serverless","detail":"A cloud model where the provider runs your code on demand and manages the servers, and you pay for what you use rather than for idle machines."},{"href":"/glossary/edge-function","label":"Edge function","detail":"A small piece of server code that runs on a CDN's servers around the world, close to the user, instead of in one central region."},{"href":"/glossary/connection-pooling","label":"Connection pooling","detail":"Keeping a set of open database connections and sharing them across requests, instead of opening a new connection for each one."},{"href":"/glossary/autoscaling","label":"Autoscaling","detail":"Automatically adding or removing computing capacity, such as servers or containers, as the load on a system goes up or down."},{"href":"/glossary/apm","label":"APM (application performance monitoring)","detail":"Tools that measure how fast and how reliably an application handles requests, and show which part of the code or which call is slow."}],"tools":[],"links":[{"href":"/pricing/categories/serverless","label":"Serverless pricing","detail":"Function and serverless prices, with sources."},{"href":"/pricing/categories/edge-functions","label":"Edge function pricing","detail":"Edge compute prices, with sources."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}