Skip to content

benchmark: sweep SESSIONS and sample the gateway's CPU and memory - #478

Merged
franciscojavierarceo merged 1 commit into
vllm-project:mainfrom
StevenWang-CY:bench-sessions-sweep
Oct 26, 2026
Merged

franciscojavierarceo merged 1 commit into
vllm-project:mainfrom
StevenWang-CY:bench-sessions-sweep

Conversation

@StevenWang-CY

Copy link
Copy Markdown
Contributor

Part of #367: its concurrent-load item, and CPU and memory beside latency.

What

scripts/run-response-provider-benchmark.sh:

  • A sweep over SESSIONS. SESSIONS may be a comma-separated list, such as 1,5,10,25,50. Each level runs as its own batch, in order, under sessions-NNNNN/ with its own summary.md, and sessions_summary.md lists the levels. A single level keeps today's layout and output.
  • The gateway's own cost. With GATEWAY_PID set to a local Agentic API server's process ID (Linux), the script reads that process's CPU time (utime + stime) and resident memory from /proc once a second during each batch, and once more when the batch ends. The samples go to the batch's gateway-usage.csv. sessions_summary.md gives each level's gateway CPU seconds, mean cores in use and peak RSS.
  • Failures. Every level runs even if one fails; the script exits with the first failing level's status, as the depth batches do.

The README's "How does concurrency affect capacity?" row and its execution-model section describe both.

Why

The README answers "How does concurrency affect capacity?" with "repeat a workload at increasing SESSIONS". #367 asks to measure "TTFT, end-to-end and tail latency, CPU, memory, queue occupancy" under concurrent load. Running the levels from one invocation keeps them comparable (same seed, same server process, one results tree). Sampling the server shows the gateway's own cost as load grows, which client-side latency does not.

Example

On one host, with each process on its own physical cores:

  • agentic-api a7dc7b5 with its SQLite store, on 4 cores of a 2× Xeon Silver 4108;
  • vLLM 0.32.0 serving Qwen3-4B-Instruct-2507-FP8 on an RTX 5060 Ti;
  • the benchmark client on 4 other cores.
WORKLOAD=transport PROVIDER=all SESSIONS=1,5,10,25,50 REQUESTS_PER_SESSION=5 TRANSPORT_ROUNDS=4 \
  MODEL=Qwen/Qwen3-4B-Instruct-2507-FP8 GATEWAY_PID="$(pgrep -nx agentic-server)" \
  ./scripts/run-response-provider-benchmark.sh

sessions_summary.md:

Sessions per provider Exit status Gateway CPU (s) Gateway cores, mean Gateway peak RSS (MiB) Summary
1 0 1.14 0.06 36.3 sessions-00001/summary.md
5 0 5.21 0.22 40.8 sessions-00005/summary.md
10 0 10.04 0.28 45.9 sessions-00010/summary.md
25 0 24.04 0.29 59.4 sessions-00025/summary.md
50 0 48.36 0.29 77.0 sessions-00050/summary.md

Read together with each level's summary.md:

  • Success. Every arm succeeded on 96–100% of turns.
  • Saturation is in the engine, not the gateway. From 25 sessions per arm, the engine is saturated: about 1.5 turns/s per arm, with p50 latency of 15 s at 25 sessions and 33 s at 50. The three Agentic API arms' p50 stayed within about 2% of direct vLLM's at every level.
  • The gateway's cost is flat per request. The gateway used at most 0.29 cores: 13–15 ms of CPU per Responses request at every load. That figure divides the CPU by the Agentic API arms' requests, 5 per transport turn, taken from each level's run.json. The script itself does not divide, since what counts as a request depends on the workload.
  • Memory. RSS grew from 36 to 77 MiB. The levels run in order against one server process, so this includes what the earlier levels stored.

Testing

  • On Linux, with a stand-in for cargo that writes a summary.md and takes 3 s:
    • a three-level sweep sampling a busy-looping process measured 3.02 s of CPU and 1.00 cores per batch;
    • a level whose batch failed did not stop the next one, and the script exited 1;
    • a single level without GATEWAY_PID kept today's layout and command.sh.
  • The sweep above, against a real server and engine.

The response_provider README answers "How does concurrency affect
capacity?" with "repeat a workload at increasing SESSIONS", and vllm-project#367 asks
for CPU and memory next to latency. The runner script now does both:

- SESSIONS may be a comma-separated list. Each level runs as its own
  batch, in order, under sessions-NNNNN/ with its own summary.md, and
  sessions_summary.md lists the levels with their exit status. A single
  level keeps today's layout.
- GATEWAY_PID names a local Agentic API server (Linux). During each
  batch the script reads its CPU time (utime + stime) and resident
  memory from /proc once a second, and once more when the batch ends,
  into gateway-usage.csv; sessions_summary.md gives each level's gateway
  CPU seconds, mean cores in use and peak RSS.

All levels run even if one fails; the script exits with the first
failing level's status, as the depth batches do.

Signed-off-by: Chuyue Wang <[email protected]>
@StevenWang-CY

Copy link
Copy Markdown
Contributor Author

@franciscojavierarceo whenever you get a chance, would you mind taking a look? This covers the concurrent-load part of #367: one run sweeps the session levels and records the gateway's own CPU and memory next to the latencies. Happy to rework it if you had a different shape in mind.

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the benchmark sweep and gateway CPU/RSS sampling. The change stays in the measurement tooling, the documented scenarios cover the new paths, and the required checks pass.

@franciscojavierarceo
franciscojavierarceo merged commit ca5385e into vllm-project:main Oct 26, 2026
15 checks passed
haoshan98 added a commit to EmbeddedLLM/agentic-api that referenced this pull request Oct 27, 2026
Brings in vllm-project#480 (ARCHITECTURE.md request admission and rate limiting),
vllm-project#481 (PostgreSQL conversation upsert), vllm-project#467 (prompt cache breakpoints on
inlined text files), vllm-project#478 (benchmark session sweep) and vllm-project#487 (test
alignment with typed Responses validation). Merged without conflicts.

Signed-off-by: haoshan98 <[email protected]>
StevenWang-CY added a commit to StevenWang-CY/flatshare that referenced this pull request Nov 2, 2026
29 records' READMEs take the newest records' form: a title with its date, an opening, findings with bold lead phrases, and How it ran and Files as tables; the sweep's table.py prints its empty cells as em dashes. Their present-tense statements are dated or corrected: vllm-project/agentic-api#478 merged on 2026-10-26, vLLM 0.33.0 came out and make-room was ported to it, vLLM #64165 is still open as of 2026-11-02, the 512-token step cap was the box's at the time. Every measured number, range, count and finding is as it was: each changed README's numbers were compared against the previous commit's.

Signed-off-by: Chuyue Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants