You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(loadtest): add USE_SYNC to benchmark the blocking client
USE_SYNC=1 drives devboxes.create through the blocking Runloop client
on a ThreadPoolExecutor instead of async AsyncRunloop + asyncio. The
sync worker pool is capped at min(REQUEST_COUNT, CONCURRENCY) with
CONCURRENCY defaulting to 5000, since one-thread-per-request is
infeasible at high counts and real socket concurrency is FD-bound
anyway. Works with USE_HTTP2 for both h1 and h2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: loadtest/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ client + server _request handling_ from provisioning.
15
15
16
16
| Script | Transport under test |
17
17
| --- | --- |
18
-
|`loadtest.py`| The **SDK** itself (`AsyncRunloop`). `USE_HTTP2=0` → HTTP/1.1; default / `USE_HTTP2=1` → HTTP/2 (shared httpx pool). Always runs against the installed package in this checkout. |
18
+
|`loadtest.py`| The **SDK** itself. `USE_HTTP2=0` → HTTP/1.1; default / `USE_HTTP2=1` → HTTP/2 (shared httpx pool). `USE_SYNC=0` (default) → async `AsyncRunloop` via asyncio; `USE_SYNC=1` → blocking `Runloop` via a thread pool. Always runs against the installed package in this checkout. |
19
19
|`h2_test.py`| Raw `httpx` HTTP/2, bypassing the SDK. Configurable connection count. |
20
20
|`h2_single_conn.py`| Raw `httpx` HTTP/2 on a single warmed connection (50-request burst). |
21
21
|`raw_fetch_test.py`| Raw `httpx` HTTP/1.1 keep-alive baseline. |
@@ -33,6 +33,10 @@ cd /path/to/api-client-python && uv sync
33
33
source~/env && REQUEST_COUNT=2000 uv run python loadtest/loadtest.py # HTTP/2
34
34
source~/env && REQUEST_COUNT=2000 USE_HTTP2=0 uv run python loadtest/loadtest.py # HTTP/1.1
|`USE_HTTP2`|`1`|`0` to force HTTP/1.1 in `loadtest.py`|
63
+
|`USE_SYNC`|`0`|`1` to benchmark the blocking `Runloop` client (thread pool) instead of async `AsyncRunloop`|
64
+
|`CONCURRENCY`|`5000`| Worker-thread cap for the sync path. Effective workers = `min(REQUEST_COUNT, CONCURRENCY)`; above the cap, requests queue through the pool. Lower it (e.g. `500`) if thread/FD pressure dominates. |
0 commit comments