What this benchmark helps you decide
Choosing a serving engine is often framed as a speed contest. For a team paying for GPU hours, the useful question is whether switching engines changes what an hour of the same GPU produces and what users feel while they wait.
This test uses the same GPU type, model, request shape, load generator and cost formula as the vLLM A40 benchmark. It helps teams choosing an engine for interactive products, where a stutter during a reply can matter as much as average speed.
Compare the baseline in the vLLM A40 report or read the vLLM, SGLang and TensorRT-LLM A40 comparison.
Why I ran this test
The vLLM test showed sharp tail-latency increases at high concurrency. Running SGLang on the same setup tests whether that behaviour came from the hardware and traffic or from the engine scheduler.
- Why SGLang: It is a widely used open-source engine with a radix cache for prefix reuse, which was on in this test, and a scheduler that by default does not mix prompt processing and token generation in one batch.
- Why the same A40 and model: Holding the remaining variables fixed creates a direct comparison with vLLM. The 48 GB card held the BF16 weights and let SGLang reserve about 428,000 KV-cache tokens.
- Why engine defaults: Defaults reflect where most teams begin. Tuning every engine would test the tuning choices as well as the engines.
Test setup
| Field | Value |
|---|---|
| Provider and location | RunPod Secure Cloud, on-demand, EU-SE-1 |
| GPU and cost basis | NVIDIA A40 48 GB at a rounded $0.60 per hour |
| Model | Qwen/Qwen2.5-7B-Instruct in BF16 |
| Serving engine | SGLang 0.5.23 with default settings |
| Request shape | 512 input tokens and 256 output tokens |
| Load generation | vllm bench serve 0.34.0 on the same Pod as the server, using random prompts |
The $0.60 hourly basis is RunPod's $0.59 GPU rate plus $0.007 for container disk, the same as the vLLM test. RunPod's billing record shows $6.01 of GPU time and $0.07 of disk, $6.08 in total for about 10.2 hours, consistent with those rates. The Pod was left running for several hours after the benchmark finished; the test itself used about one hour. Idle time does not change the figures on this page, which come from the hourly rate and measured throughput, but a rented GPU costs the same whether or not it is working. The billing record is in the downloads, with the Pod ID removed.
SGLang reported 428,234 tokens of KV cache after loading, against 505,856 for vLLM, because its default static memory fraction is 0.843 rather than 0.9. Both are far more than this test needed: 64 concurrent requests of 768 tokens each use under 50,000. SGLang captured decode CUDA graphs for batch sizes up to 32, so larger batches at concurrency 64 ran without one. Start-up took about two minutes, most of it graph capture.
Repeatability
The full sweep ran twice with identical settings, and both sweeps have raw JSON exports and checksums. The second sweep supplies the tables on this page. Output throughput agreed within 0.4% at concurrency 1, 32 and 64. Both sweeps used the same prompts and the second ran on a warm cache, so that agreement shows a stable run rather than independent repeats.
At concurrency 8 the first sweep was about 9% lower because one request stalled: its p99 time to first token was 7.6 seconds against a median of 139 milliseconds. The stall did not repeat in the second sweep (p99 590 milliseconds) or in the later cold check, so it is treated as warm-up rather than a cache effect.
| Concurrency | Sweep 1 tok/s | Sweep 2 tok/s |
|---|---|---|
| 1 | 35.64 | 35.65 |
| 8 | 241.94 | 265.71 |
| 32 | 872.16 | 872.76 |
| 64 | 1,458.48 | 1,453.25 |
Benchmark results
Swipe or scroll horizontally to compare every column.
| Concurrency | Requests | Output tok/s | Median TTFT | p99 TTFT | Median TPOT | p99 ITL | $ / 1M output (derived) | $ / 1K requests (derived) |
|---|---|---|---|---|---|---|---|---|
| 1 | 50 | 35.7 | 94 ms | 112 ms | 27.8 ms | 28.5 ms | $4.68 | $1.20 |
| 8 | 80 | 265.7 | 114 ms | 590 ms | 29.1 ms | 30.5 ms | $0.63 | $0.16 |
| 32 | 320 | 872.8 | 1,203 ms | 2,167 ms | 31.9 ms | 33.3 ms | $0.19 | $0.049 |
| 64 | 640 | 1,453.3 | 290 ms | 4,260 ms | 35.6 ms | 44.1 ms | $0.11 | $0.029 |
Every valid request completed and produced 256 output tokens. Median time per output token rose gently, from 27.8 to 35.6 milliseconds, and p99 inter-token latency stayed below 45 milliseconds at every load. Time to first token widened most, reaching about 4.3 seconds at p99 under the highest load. With a cold cache, the medians at concurrency 32 and 64 would be considerably higher.
What these figures include: a warm prefix cache
Every load level in this test reused the prompts of the level before it, and the second sweep, which supplies the tables above, repeated the first exactly. SGLang's radix cache was on by default, so much of the prompt processing in the published run was served from cache. The figures describe a warm cache, not traffic in which every prompt is new.
A later A40 run measured both on one card: a cold sweep with new prompts at every level on a freshly started server, then this test's warm method. At concurrency 64, SGLang's cold throughput was 16% below its warm figure and its median time to first token rose from 279 to 2,312 milliseconds; at concurrency 1 there was no difference. Applied to this result, cold traffic at full load would cost about $0.14 per million output tokens rather than $0.11. The same check on an RTX 6000 Ada found a 19% drop.
That later A40 was about 20% faster than the card in this test, most likely because it had ECC memory protection off, so use the percentage change rather than its absolute figures. The RTX 6000 Ada vs A40 comparison covers that difference.
Two findings hold with cold prompts: throughput matched vLLM, and SGLang's streaming stayed smooth, at 44 milliseconds p99 inter-token latency at concurrency 64 against 286 for vLLM on a later A40, and 28 against 287 on an RTX 6000 Ada. One did not: with cold prompts, the three engines' p99 time to first token at concurrency 32 and 64 were within about 7% of each other, and vLLM was not the fastest.
Swipe or scroll horizontally to compare every column.
| Concurrency | Requests | Output tok/s | Median TTFT | p99 TTFT | Median TPOT | p99 ITL | $ / 1M output (derived) | $ / 1K requests (derived) |
|---|---|---|---|---|---|---|---|---|
| 1 | 50 | 42.4 | 95 ms | 137 ms | 23.3 ms | 24.0 ms | $3.93 | $1.01 |
| 8 | 80 | 304.8 | 560 ms | 594 ms | 24.1 ms | 25.5 ms | $0.55 | $0.14 |
| 32 | 320 | 886.0 | 1,383 ms | 9,057 ms | 28.6 ms | 31.0 ms | $0.19 | $0.048 |
| 64 | 640 | 1,394.5 | 2,312 ms | 4,259 ms | 37.0 ms | 43.9 ms | $0.12 | $0.031 |
With new prompts on that A40, SGLang's p99 inter-token latency at concurrency 64 was 44 milliseconds against 286 for vLLM on the same card, so the streaming gap held. At concurrency 32, 31 of 320 requests each waited about 9.1 seconds for their first token against a median of 1.4 seconds, most likely one stall holding up a whole group of requests, like the one-off stalls SGLang showed on the other cards.
The warm and cold runs, with the engines' own cache counters, are in the same-card A40 run notes and its summary CSV.
How SGLang kept streaming smooth at 32 and 64
At concurrency 32 and 64, vLLM's p99 inter-token latency reached 274 and 293 milliseconds. SGLang stayed at 33 and 44 milliseconds on the same card and traffic. Median speed was nearly identical; the difference was in the slowest gaps, and it held in the cold check, at 24 and 28 milliseconds for SGLang against 277 and 287 for vLLM.
The most likely reason is a scheduling default. vLLM batches new requests' prompt processing together with the steps that generate tokens for requests already running, so some generation steps carry extra work and take far longer. SGLang's option to mix prompt processing and generation in one batch, --enable-mixed-chunk, is off by default, so its generation steps stay short and even.
For a chat product, steady streaming usually matters more than a slightly faster start. For batch work, neither matters much. This test did not trace individual scheduler steps, so the explanation is the most likely cause rather than a measured one.
Self-hosted or API: where the break-even sits
On 20 November 2026, I recorded an OpenRouter list price of $0.10 per million input tokens and $0.20 per million output tokens for this model. A later check left the price unverified, so I use it here as a historical reference. The vLLM A40 report has the full note.
| Concurrency | Req/s | Self-hosted (derived) | API (historical reference) | API lower (modelled) | Cheaper |
|---|---|---|---|---|---|
| 1 | 0.14 | $1.20 | $0.10 | $0.046 | API |
| 8 | 1.04 | $0.16 | $0.10 | $0.046 | API |
| 32 | 3.41 | $0.049 | $0.10 | $0.046 | Depends on rate |
| 64 | 5.68 | $0.029 | $0.10 | $0.046 | Self-hosted |
Because SGLang's throughput matched vLLM's, the break-even barely moves: about 1.6 requests per second sustained at the recorded price, or about 3.6 at the modelled lower price. The break-even depends on the hourly rate and the API price, not on the engine. The self-hosted costs at concurrency 32 and 64 are warm-cache figures; with cold prompts they would be roughly a fifth higher, which leaves each row's verdict unchanged.
Idle hours still cost $0.60 each, while an API charges nothing between requests. The comparison also excludes the engineering time required to operate and monitor a server.
How the attributed cost was calculated
This isolates the rented GPU time, including the Pod's own disk, attached to one million output tokens. A production model also includes other storage, transfer, cold starts, idle capacity, retries, observability and engineering work. The methodology keeps measured, published and modelled evidence distinct.
What this result can support
- Engine choice on this card is a latency decision more than a cost decision: throughput, and therefore attributed cost, was within 1.5% of vLLM, and cold runs on two other cards found the same tie.
- Interactive products that stream responses should look at p99 inter-token latency, not just the median. On the same hardware, the engine changed it by a factor of six at high load.
- Teams that care about time to first token under heavy load should measure it with their own traffic. The warm A40 run favoured vLLM; cold runs on two other cards put all three engines within about 7% at full load.
- Benchmarks that repeat prompts measure the prefix cache as well as the engine. Test with traffic that matches how often your own prompts repeat.
Use the GPU memory estimator to examine model fit before choosing hardware.
Evidence boundary
The result covers one GPU type, one model, SGLang 0.5.23 with default settings and synthetic random prompts of fixed length. Every load level reused the previous level's prompts and the second sweep repeated the first, with SGLang's radix cache on, so the published figures reflect a warm cache. The cold effect quoted on this page was measured on a later, faster A40 and on an RTX 6000 Ada, not on this card.
Tuned settings, such as enabling mixed chunks or changing the chunk size, could shift the latency trade-off in either direction. The load generator ran on the same Pod as the server and shared its CPU. The Pod ran in a different RunPod region from the vLLM test (EU-SE-1 rather than CA-MTL-1); both were Secure Cloud A40s at the same hourly rate. The API comparison uses a list price on one date, not a measured API run.
Read GPU billing explained to compare billing increments, minimum charges and stop events.
Where this test sits in the research
This test forms part of the A40 column in the research matrix. The tests share a model, request shape and cost formula, with each engine running on a separate A40.
- Same card, other engines: vLLM came first and TensorRT-LLM completes the A40 column. The three-engine comparison brings them together.
- Same engine, other card: the RTX 6000 Ada, the same 48 GB on a newer, more expensive chip with FP8 support. Read the SGLang RTX 6000 Ada benchmark.
| Serving engine | NVIDIA A40 48 GB | NVIDIA RTX 6000 Ada 48 GB |
|---|---|---|
| vLLM | Field test 001 | Field test 004 |
| SGLang | This test | Field test 005 |
| TensorRT-LLM | Field test 003 | Field test 006 |
Frequently asked questions about this benchmark
What did this SGLang A40 benchmark measure?
It measured output throughput, time to first token, time per output token and inter-token latency while Qwen2.5-7B-Instruct ran through SGLang 0.5.23 on one rented NVIDIA A40. The four load levels used concurrency 1, 8, 32 and 64 with the same 512-token input and 256-token output shape as the vLLM test.
Was SGLang faster than vLLM?
Not in throughput. On the same card and traffic, the two engines were within 1.5% at every load level, so the derived GPU cost per million output tokens was almost identical: about $0.115 for both at concurrency 64 with a warm prefix cache. Cold runs on two other cards found the same tie.
What was different about SGLang?
Its slowest tokens arrived far more evenly. At concurrency 64, p99 inter-token latency was 44 milliseconds against 293 for vLLM, and the gap held with cold prompts. In this warm-cache run its worst-case wait for the first token was also longer than vLLM's, but cold runs on two other cards did not repeat that.
Why did SGLang stream more smoothly?
The most likely reason is that SGLang, by default, does not mix prompt processing into the same batch as token generation, so generation steps stay short. This test did not trace scheduler steps, so that is the most likely cause rather than a measured one.
Did the prefix cache affect the results?
Yes, at the higher loads. The test reused prompts, so SGLang's radix cache served much of the prompt processing. Measured warm and cold on one later A40, throughput at concurrency 64 was 16% lower with new prompts and the median wait for the first token was several times longer, with no difference at concurrency 1.
When was the rented GPU cheaper than the API?
Using the historical OpenRouter price I recorded on 20 November 2026, unverified on recheck, the break-even was about 1.6 requests per second sustained. The API was cheaper at the two lower load levels and the rented A40 was cheaper at concurrency 64.
Which costs are included?
The derived figures attribute the rounded hourly GPU and disk rate to output measured with a warm prefix cache. They exclude idle capacity, storage, transfer, retries, observability and engineering work.
Download and inspect the evidence
- Benchmark notes and method
- Download the summary CSV
- Raw JSON at concurrency 1
- Raw JSON at concurrency 8
- Raw JSON at concurrency 32
- Raw JSON at concurrency 64
- First-sweep JSON at concurrency 1
- First-sweep JSON at concurrency 8
- First-sweep JSON at concurrency 32
- First-sweep JSON at concurrency 64
- Both sweeps with file hashes
- RunPod billing record
- SHA-256 checksums
- Prefix-cache check notes (RTX 6000 Ada, warm and cold)
- Prefix-cache check summary CSV
- Qwen2.5-7B-Instruct model card
- OpenRouter model page (price not currently shown)
- SGLang server arguments and mixed-chunk setting
- Questions and corrections: data@compareaicost.com