feat: add HTTP/2 load testing infrastructure#819
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Match the TS loadtest's RequestResult by recording the exception message per request, and print a breakdown of the opaque network_error bucket so transport-level failures (timeouts, resets, pool exhaustion) are diagnosable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jrvb-rl
approved these changes
Jul 11, 2026
jrvb-rl
left a comment
Contributor
There was a problem hiding this comment.
Thanks for putting this together, Yoon. I added one bit to bring the error reporting in line with the TS loadtest. I also had claude run a comparison and add the results to the PR description.
I'll land, so I can add sync SDK tests onto this.
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.
Note: pair pr
Summary
A
loadtest/toolkit for benchmarking the SDK's request handling, plus raw-transport baselines. The SDK harness (loadtest.py) fires a burst ofdevboxes.createcalls at a deliberately nonexistent blueprint (bp_nonexistent_loadtest_00000): every request fails fast server-side (HTTP400, no devboxes created), isolating client + server request handling from provisioning.Scripts (real-API)
loadtest.pyAsyncRunloop).USE_HTTP2=0→ HTTP/1.1; default → HTTP/2 (shared httpx pool). Always runs against the installed package in this checkout.h2_test.pyhttpxHTTP/2, bypassing the SDK. Configurable connection count.h2_single_conn.pyhttpxHTTP/2 on a single warmed connection (50-request burst).raw_fetch_test.pyhttpxHTTP/1.1 keep-alive baseline.alpn_check.pyh2via TLS ALPN.Usage
Test plan
loadtest.pyruns for both transports; all requests400(no devboxes created).Python vs TS comparison
Ran
loadtest.pyagainst the pair PR'sloadtest.tson the dev cluster (api.runloop.pro), 2000 requests each, all400by design (no devboxes created):HTTP/1.1 is comparable (both bottlenecked on socket-per-request + the 4096 FD cap). On HTTP/2, Python is ~7× slower than TS against the same server. The raw
h2_test.pyprobe isolates the cause: raw httpx-h2 plateaus at ~485–560 req/s and going from 10→50 connections barely moves it — so the ceiling is httpx/httpcore's pure-Pythonh2state machine (CPU-bound under the GIL), not the SDK'smax_connections=20pool. TS's nativenode:http2(C++) has no such ceiling. This is inherent to the transport stack, not a loadtest bug.Also in this revision
loadtest.pynow captures a per-requesterrormessage (parity with the TSRequestResult) and prints a breakdown of thenetwork_errorbucket, so transport-level failures (timeouts, resets, pool exhaustion) are diagnosable.🤖 Generated with Claude Code
Reflex session: https://reflex.runloop.ai/orgs/runloop/agents/agt_4Sg729tM9zLk7ayz20XNib