Why vLLM Takes So Long to Start, and How to Speed It Up
vLLM spends startup time loading weights, compiling and capturing CUDA graphs. What each step costs, which flags trade speed for performance, and what to cache.
By Cogniq Labs ResearchEvidence policy

vLLM can take minutes to start, even for a small model, and it is easy to assume something is wrong. Usually nothing is. Startup is doing real work: loading the weights, compiling the model, measuring memory and capturing CUDA graphs. Most of that work exists to make generation faster later. You can keep the results from one start for the next, and you can skip steps when you care more about starting quickly than about speed.
This note explains the stages, what controls each, and the settings that trade one for the other.
What happens when vLLM starts
A start has four main stages. The exact order and names vary between versions, but the work is the same:
| Stage | What it does | What it depends on |
|---|---|---|
| Load weights | Reads the model from disk or the network into GPU memory | Model size, storage speed |
| Compile | Runs torch.compile to produce optimised code for the model | Model, vLLM and torch versions, GPU |
| Profile memory | Measures memory use to size the KV cache | Model and settings |
| Capture CUDA graphs | Records the GPU operations for common batch sizes, so they can be replayed cheaply | Capture sizes, optimisation level |
Which of these dominates depends on your situation. A large model on slow network storage spends most of its time loading. A small model on a fast disk spends most of its time compiling and capturing graphs. The startup log shows timings, and reading them tells you which stage to attack.
The conserving memory guide adds one detail about loading: with tensor parallelism, each process reads the whole model, so disk loading slows as the number of GPUs grows, and a sharded checkpoint can reduce the load time.
The biggest win: keep the compile cache
Compilation is the stage you can most often skip entirely. The optimization guide says vLLM persists torch.compile artifacts under VLLM_CACHE_ROOT, which defaults to ~/.cache/vllm, and that the cache directory can be copied between machines or baked into a container image. The torch.compile page shows the log line that tells you where it is:
Using cache directory: ~/.cache/vllm/torch_compile_cache/<hash>/rank_0_0
That page states the practical consequence: you can copy the whole torch_compile_cache directory into your deployment to save a great amount of compilation time.
The condition is that the setup must match. The guide says any change to the model, the config, relevant VLLM_* environment variables, the torch build or the GPU model invalidates the cache. In practice:
- In Docker or Kubernetes, a cache stored inside the container is lost on every restart. Mount a persistent volume at the cache path, or build the cache into the image.
- After a vLLM upgrade, expect one slow start while the cache is rebuilt. This is normal, and the next start is quicker.
- If you scale out, build the cache once and ship it, so each new replica starts warm.
The guide also names a flag for catching silent misses: set VLLM_FORCE_AOT_LOAD=1 to fail loudly instead of silently recompiling when the cache does not match. That is useful in production, where a surprise ten-minute compile is worse than an error.
Skip memory profiling
The guide describes a second saving. On startup, vLLM logs the exact --kv-cache-memory value that reproduces the current allocation. Passing it back on the next boot skips the memory-profiling measurement and the CUDA graph memory estimation pass.
The guide is careful about the cost. The cache is sized to exactly the given value instead of being measured, so a conservative value caps concurrency and throughput, while an optimistic one fails at allocation time. The value is only valid on the same GPU with the same initial free memory. If a start runs out of memory after the hardware or other processes change, remove the flag so it measures again.
This is a deployment optimisation for a fixed machine, not something to enable by default.
Trade speed for startup with optimisation levels
vLLM exposes this trade directly. The optimization guide lists four levels:
| Level | What it does |
|---|---|
-O0 |
No optimisations. Fastest startup time, lowest performance |
-O1 |
Fast optimisation: simple compilation and fast fusions, with piecewise CUDA graphs |
-O2 |
The default: more compilation ranges, more fusions, and full-and-piecewise CUDA graphs |
-O3 |
Aggressive. Currently equal to -O2, but may add more time-consuming optimisations |
For development, -O0 or -O1 can cut the wait a lot. For production, the default exists because steady-state speed matters more than a one-off start.
The development shortcut: eager mode
For the fastest possible start, --enforce-eager skips compilation and graph capture altogether. The guide describes it as useful for development loops and for measuring how much of a boot is compile and capture. The engine arguments page says it disables both torch.compile and CUDA graphs.
vllm serve meta-llama/Llama-3.1-8B-Instruct --enforce-eager
The cost is generation speed. Without CUDA graphs, each decode step does more work on the CPU side, so generation is slower. It is a good way to test whether a configuration works, and a poor way to run a service.
Fewer CUDA graphs, shorter capture
CUDA graphs are captured for a set of batch sizes, and each one takes time and memory. The memory guide explains that CUDA graphs speed up inference but use extra GPU memory, that the default goes up to max_num_seqs, and that you can tune compilation_config with cudagraph_capture_sizes to capture fewer. The CUDA graphs design page says the same from the other side: larger caps and longer lists capture more and wider graphs, which take memory from the KV cache and lengthen startup.
If your traffic never reaches large batch sizes, capturing graphs for them is wasted time. Lowering --max-num-seqs to what you actually serve shortens the list, and it also leaves more memory for the cache, which we cover in why vLLM runs out of memory.
Do not download the model on every start
In a container, the model files are the other thing that quietly goes missing. If the Hugging Face cache lives inside the container, every restart downloads the model again, and for a large model that dwarfs everything else in this note. Mount the cache from the host or from a persistent volume, and mount the vLLM cache next to it:
docker run --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-v ~/.cache/vllm:/root/.cache/vllm \
-p 8000:8000 vllm/vllm-openai:latest \
--model meta-llama/Llama-3.1-8B-Instruct
That is an example, not a recipe: paths and image names depend on your setup. The idea is that both caches survive a restart, so the second start skips the download and the compilation, and only does the work that cannot be saved.
When startup times out
vLLM waits a limited time for the engine to become ready. The environment variables page lists VLLM_ENGINE_READY_TIMEOUT_S with a default of 600 seconds, or ten minutes. A very large model from slow storage can exceed that, and the symptom is an error that looks like a crash. Raise the value, and also look at loading speed: local NVMe storage is much faster than a network share, and a sharded checkpoint helps with multi-GPU loads.
Is the slow start worth fixing?
It depends on how often you start. A long-running service that starts once a week can spend ten minutes on startup and nobody will notice. The cost shows up in three places:
- Autoscaling. New replicas take minutes to become ready, so traffic spikes are served late. Warm caches matter most here.
- Deployments and rollbacks. Every release restarts the servers, and a slow start stretches the window in which capacity is short.
- Development. A thirty-second edit followed by a five-minute restart ruins iteration, which is the case for
-O0or--enforce-eagerwhile developing.
For a service that does not scale or restart often, leave the defaults alone. The extra optimisation is paid back in generation speed on every request afterwards.
How to find your own bottleneck
- Read the startup log with timestamps. Note when weights finish loading, when compilation finishes, and when graph capture finishes. The gaps show where the time goes.
- If loading dominates, move the model to faster storage, use a sharded checkpoint, or load from a local copy instead of downloading on every start.
- If compilation dominates, persist the compile cache and reuse it.
- If graph capture dominates, lower
--max-num-seqsor reduce the capture sizes. - If you are developing, use
-O0or--enforce-eager. - If you are deploying, bake in the cache, pin the vLLM version, and consider
--kv-cache-memoryfor a fixed machine.
What about slow generation?
"Slow" can mean slow to start or slow to generate, and the fixes are different. If startup is fine but responses are slow, the cause is usually load or memory, not configuration. A server that is preempting requests because the cache is full will feel slow under load, and one that is running a single request at a time wastes the batching vLLM is built for. Decode speed also depends on how much weight data has to be read per token, which is why quantization and speculative decoding help. For a comparison with running models locally for one person, see why Ollama runs out of memory.
What we do not know
We have not measured startup on hardware, and the stage table is a conceptual breakdown, not a benchmark. vLLM changes quickly: flags, defaults and what each optimisation level does can differ between releases, so read the documentation for the version you run. Startup time also varies with the model, the GPU, the disk and the vLLM release, so the only reliable numbers are the timestamps in your own log.
Sources
- Optimization and tuning — vLLM
- torch.compile integration — vLLM
- Engine arguments — vLLM
- Environment variables — vLLM
- Conserving memory — vLLM
Frequently asked questions
Why does vLLM take so long to start?
Startup is several steps: loading the weights from disk, compiling the model with torch.compile, measuring memory, and capturing CUDA graphs. Each can take a noticeable time, and compilation and graph capture are done again whenever the setup changes. Most of the cost is paid to make generation faster afterwards.
How can I make vLLM start faster?
Keep the compile cache between restarts, which vLLM stores under VLLM_CACHE_ROOT, and bake it into your container image. For development, use --enforce-eager or the -O0 optimization level to skip compilation and graph capture, at the cost of slower generation.
What does --enforce-eager do?
It turns off torch.compile and CUDA graphs. The vLLM docs say it skips both compilation and graph capture for the fastest possible startup, at the cost of steady-state decode performance, and that it is useful for development loops.
Does vLLM reuse compilation between restarts?
Yes, if the setup matches. vLLM keeps torch.compile artifacts under VLLM_CACHE_ROOT, by default ~/.cache/vllm. The docs say any change to the model, config, relevant environment variables, torch build or GPU model invalidates the cache, so a new vLLM version means one slow start.
Why does vLLM time out while starting?
The engine has a limit for becoming ready. The environment variables page lists VLLM_ENGINE_READY_TIMEOUT_S, with a default of 600 seconds, or ten minutes. If loading a large model from slow storage takes longer, raise it.
Related reading
Ollama 'Model Requires More System Memory': The Fix
What Ollama's two memory numbers actually measure, why Docker and WSL report less than you have, which versions show this error, and how to fix it.
llama.cpp 'Failed to Fit Params': What It Means
The failed to fit params line in llama.cpp is a warning, not the crash. What the fit step adjusts, what each reason means, and which flags to change.
Why Ollama Is Slow Even When It Runs on the GPU
Slow Ollama replies on a GPU come from loading, reading the prompt or writing the answer. How to measure each with Ollama's own timings, and what to change.