Skip to content

Commit 6b22339

Browse files
yoon-park-rlclaude
andcommitted
docs(loadtest): add pool_check.py to README and remove dead open_connections_to helper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e50d991 commit 6b22339

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

loadtest/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ client + server _request handling_ from provisioning.
2020
| `h2_single_conn.py` | Raw `httpx` HTTP/2 on a single warmed connection (50-request burst). |
2121
| `raw_fetch_test.py` | Raw `httpx` HTTP/1.1 keep-alive baseline. |
2222
| `alpn_check.py` | Confirms the origin negotiates `h2` via TLS ALPN. |
23+
| `pool_check.py` | Verifies that multiple sync `Runloop` instances share a single connection pool (transport object identity check, no real requests). |
2324

2425
The raw-transport probes compare httpx HTTP/2 multiplexing against HTTP/1.1
2526
directly — the same comparison that motivates the SDK's shared HTTP/2 pool.
2627
They're kept so the comparison stays reproducible.
2728

29+
`pool_check.py` is a lightweight sanity check (no API key, no real requests) that
30+
confirms multiple sync `Runloop` instances reuse a single underlying transport
31+
object — preventing file-descriptor exhaustion when many clients are instantiated.
32+
2833
```sh
2934
# Install the SDK from this checkout (editable):
3035
cd /path/to/api-client-python && uv sync

loadtest/pool_check.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@
2525
N = 20
2626

2727

28-
def open_connections_to(host: str) -> int:
29-
"""Count ESTABLISHED TCP connections to *host* via lsof."""
30-
try:
31-
out = subprocess.check_output(
32-
["lsof", "-i", f"@{host}", "-sTCP:ESTABLISHED", "-n", "-P"],
33-
stderr=subprocess.DEVNULL,
34-
text=True,
35-
)
36-
return max(0, len(out.strip().splitlines()) - 1) # subtract header
37-
except Exception:
38-
return -1 # lsof unavailable
39-
4028

4129
def main() -> None:
4230
fd_before = resource.getrlimit(resource.RLIMIT_NOFILE)[0]

0 commit comments

Comments
 (0)