To measure a serverless GPU cold start, I would time the complete request at the client and separately collect evidence about the worker’s lifecycle. The first request in a script is not automatically cold, and a slow response is not automatically model loading. Those distinctions determine whether I should change packaging, capacity, initialization, or the interface.
My aim is to explain the wait a person experiences. A fast inference timer inside the handler cannot account for time spent reaching that handler.
I would write the product deadline beside the measurement plan. A transcript returned after a notification and a response needed during a live interaction have different acceptable waits. Without that requirement, shortening startup can become an optimization with no clear stopping point.
Define the wait before choosing the timer
For a synchronous endpoint, I would measure from just before sending the request until the complete response body arrives. That captures the client-observed completion time, including transport and service delays. If the application submits an asynchronous job, I would instead track submission and eventual result availability as separate events.
Beam’s cold-start guide identifies capacity discovery, image loading, and application initialization as startup components. I would look for those stages in platform records rather than infer all of them from a single handler timer.
My measurement sheet would distinguish these observations:
Observation | What it tells me | What it cannot establish alone |
|---|---|---|
Client completion duration | How long this caller waited | Which internal stage dominated |
Platform queue and lifecycle records | Scheduling and worker events | Every browser or network delay |
Initialization duration | Work inside the startup loader | Capacity discovery before startup |
Handler duration | Work inside the request function | Full user-visible response time |
First meaningful streamed token | When useful output began | When a validated final answer was ready |
I would not subtract timestamps from unrelated machines without accounting for clock alignment. For durations inside one process, a monotonic timer avoids changes to the wall clock. A UTC timestamp is still useful for matching records, but it serves a different purpose.
Separate cold, warm, and uncertain observations
I would label a request cold only when lifecycle evidence shows that a new worker initialized to serve it. A request on an already initialized worker can be warm. When the records do not establish which happened, I would keep an “unknown” label rather than force it into the faster group.
There are several caches to distinguish: container-image availability, downloaded model files, initialized model state, and any prompt or application cache. “Cache enabled” is not a sufficiently precise experiment description. A new worker can load weights from an existing disk cache while still spending time initializing the model.
For cold start vs warm start inference, I would hold the model revision, input, output limit, engine, and resources steady. The waiting period before a test should be recorded, but waiting a fixed number of minutes does not prove the worker was removed. I would confirm the lifecycle transition where the platform exposes it.
I would also record concurrent traffic. A burst can start additional workers even while an existing worker remains warm. Calling the whole deployment “warm” hides the experience of requests routed to newly created capacity.
Capture complete responses without inventing a benchmark
Here is a small client-side timing script for a synchronous JSON endpoint. It reads the URL and token from the environment, sends a synthetic fixture, and prints one record. It is a collection example, not a report of measurements performed for this article.
import json
import os
import time
from datetime import datetime, timezone
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
payload = Path("request.json").read_bytes()
request = Request(
os.environ["BEAM_URL"], data=payload, method="POST",
headers={
"Authorization": "Bearer " + os.environ["BEAM_TOKEN"],
"Content-Type": "application/json",
},
)
record = {"started_utc": datetime.now(timezone.utc).isoformat()}
start = time.perf_counter()
try:
with urlopen(request, timeout=60) as response:
body = response.read()
record.update(http_status=response.status, response_bytes=len(body))
except HTTPError as exc:
record.update(http_status=exc.code, error_type="HTTPError")
except (URLError, TimeoutError) as exc:
record.update(error_type=type(exc).__name__)
record["client_elapsed_seconds"] = round(time.perf_counter() - start, 6)
print(json.dumps(record))The success path reads the whole body. For a failed request, the recorded duration ends at the exception instead; I would not mix it into successful completion latency. The socket timeout is not a guaranteed total application deadline, and HTTP success still needs a separate output-contract check.

Python’s time documentation describes perf_counter as a high-resolution duration counter. I would use the same client, network location, and connection behavior across comparisons. Changing the client while changing the server creates another explanation for a timing difference.
For an LLM stream, the first byte might be a header, heartbeat, or empty event. I would parse the protocol and time the first meaningful output token. NVIDIA’s inference metric definitions distinguish time to first token from complete request latency; neither should be renamed to make a chart look faster.
Run three experiments with different purposes
I would begin with one verified fresh-worker request, then repeat the fixture on the initialized worker. That pair can reveal a startup contribution, but it is not a latency distribution. I would preserve both records and their worker identifiers where available.
Next, I would collect repeated warm requests under the expected request pattern. I would report how many completed, how many failed, input lengths, output lengths, and the concurrency used. A median or percentile without a sample count conceals how much evidence supports it.
Finally, I would test a burst that can exceed existing warm capacity. That answers whether scale-out creates long waits even when an occasional manual request feels responsive. The burst should resemble the product’s expected arrivals, rather than simply use the largest concurrency the test client can generate.
I would choose the observation window before collecting results. A lunchtime lull, an opening-hour burst, and a steady background queue can produce different proportions of startup requests. Combining them without their counts makes the average difficult to apply to any one user journey. I would preserve a small summary for each traffic condition, alongside the combined view.
Suppose most calls are warm but a small minority initialize workers. A percentile over all successful calls can hide some startup experiences, depending on the fraction and the percentile chosen. I would therefore show the cold subset separately even if the overall median looks excellent. That is an explanation of mixed populations, not a claim about Beam’s observed distribution.
For a small prototype, these experiments may remain modest. I would state the limitation instead of labeling a few successful calls production validation. More repetitions are useful when they test a meaningful uncertainty, not when they merely repeat an already established result.
Choose the correction from the dominant stage
If startup records show repeated downloads, I would inspect artifact caching and revision paths. If initialization dominates, I would check what loads per worker and whether unnecessary setup occurs before readiness. If queueing dominates, image trimming alone is unlikely to resolve the whole wait.
I would make one change per comparison and state the expected effect. Moving model files into a persistent cache should change repeated download work; it need not remove framework initialization. Loading a model once per worker should remove repeated request-time loading; it need not improve capacity discovery. Keeping those predictions separate helps identify whether a faster run actually supports the proposed explanation.
If warm requests are also slow, I would inspect the inference workload and serving behavior. Cold-start optimization cannot explain a delay that remains after initialization. Equally, a fast warm benchmark says little about an infrequent feature whose users usually arrive after idle periods.
Beam’s keep-warm documentation makes the cost tradeoff explicit: warm containers are billable, and baseline containers remain running while the deployment is active. Maintaining some warm capacity does not establish that every burst fits within it.

I would compare keep-warm settings using the same arrival trace and count paid idle time alongside successful requests. If traffic is rare, an asynchronous interface with a clear pending state may fit better than paying continuously to eliminate a short wait. If the task must complete interactively, that option may be unacceptable; the deadline decides.
I would keep failed and timed-out attempts in the experiment record. Removing them can make latency look better precisely when the experience got worse. For percentiles over successful requests, I would label that population and report the failure count beside it.
A useful measurement note ends with a bounded conclusion: which stage changed, under what traffic, and whether the completion requirement was met. On your next test, add a lifecycle label and an output-validity result beside the client duration. Those two fields make the number much harder to misread.
No letters yet — be the first to write.