Repository navigation
feat(scripts): server metrics measure many threads working at once with one client - #41371
Merged
Merged
Conversation
juliusmarminge
force-pushed
the
perf/server-metrics-working
branch
from
November 23, 2026 10:31
fdf7f10 to
3f93f69
Compare
juliusmarminge
force-pushed
the
perf/server-metrics-noise
branch
from
November 23, 2026 10:31
c035771 to
027d515
Compare
Contributor
Thread transfer impact
This comment will update automatically after the next completed run. |
juliusmarminge
force-pushed
the
perf/server-metrics-working
branch
from
November 23, 2026 14:02
3f93f69 to
416b181
Compare
juliusmarminge
force-pushed
the
perf/server-metrics-working
branch
from
November 23, 2026 14:15
416b181 to
ac44961
Compare
…th one client Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge
force-pushed
the
perf/server-metrics-working
branch
from
November 23, 2026 14:21
ac44961 to
1268612
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
None of the scenarios measured what the maintainers care about most: many threads working at once with one or a few clients attached.
workingruns 5, then 10, then 20 threads, each in a worktree of its own (thread start --worktree main), all running turns back to back at the same time. One client is attached over the real WebSocket RPC and subscribed to all of them like the web client (shell, VCS status, every thread, activity reports). That client sends each turn as amessage.dispatchand sees the run end on its thread subscription, so turns don't spawn a CLI per send.Each turn is realistic: the fake API streams a 150-word reply that ends in a
Writetool call into the agent's working directory (read from the CLI's prompt), the realclaudeCLI writes the file, the follow-up streams a short answer, and the turn's checkpoint captures a real change.Per window: CPU, wakeups, RSS, heap after GC, ELD p50/p99/max, GC count/pause, turns per minute, send to the first API request, the last reply byte to the client seeing the run end, and whole-turn time. Fits over the windows give heap, RSS, CPU and p99 delay per working thread.
comparetreats*PerMinas higher-is-better (table test).Cups,
ab <same> <same> --rounds 5 --only working: medians of 10 runs on a quiet machine (load 1.9–4, other processes ≤ 0.11 cores):Each working thread adds 0.22 MB of heap and 1.26 MB of RSS. With
--no-agent-scope(6 runs) the shape is the same: 32–37 turns/min, and turn end 3.7 s → 16.4 s.Throughput stays at ~38 turns/min whether 5 or 20 threads work. The server sits just above one core, and p50 loop delay climbs from 3.5 ms to 16.5 ms. The time from a reply's last byte to the client seeing the run end grows 5× (3.0 s → 14.8 s). The server, not the agents, is the bottleneck, and this is the scenario to hill-climb on. It is also the steadiest scenario under A/A: every per-window metric that gates resolves a 6–29% change per 5-round
ab, and the floors inNOISE_RULEScome from these runs (table on #41370). On a machine at load 21 the same scenario showed the same plateau (31–33 turns/min) with turn end at 16.7 s.Stacked on #41370.
Model: Claude Opus 5.5, harness: Claude Code in T3 Code.
🤖 Generated with Claude Code