From 1863b12c5aa95508b0c6c1d4e462cac970b494a9 Mon Sep 17 00:00:00 2001 From: Sendao Yan Date: Fri, 6 Nov 2026 10:27:28 +0800 Subject: [PATCH] Fix bm_fastapi benchmark failing with httpx.PoolTimeout under load --- .../data-files/benchmarks/bm_fastapi/run_benchmark.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyperformance/data-files/benchmarks/bm_fastapi/run_benchmark.py b/pyperformance/data-files/benchmarks/bm_fastapi/run_benchmark.py index 09c7dc2c..e34f6658 100644 --- a/pyperformance/data-files/benchmarks/bm_fastapi/run_benchmark.py +++ b/pyperformance/data-files/benchmarks/bm_fastapi/run_benchmark.py @@ -63,7 +63,8 @@ def setup_server(): def bench_fastapi(loops, url): async def run_benchmark(): - async with httpx.AsyncClient(trust_env=False) as client: + limits = httpx.Limits(max_connections=CONCURRENCY) + async with httpx.AsyncClient(limits=limits, trust_env=False) as client: t0 = pyperf.perf_counter() for i in range(loops):