From 8ec57c295bf20c780938941399d8ec42884c8dde Mon Sep 17 00:00:00 2001 From: ZhangLirong-amd Date: Mon, 29 Jun 2026 05:58:28 +0000 Subject: [PATCH] fix(benchmark): raise RLIMIT_NOFILE in benchmark_serving for high concurrency At high --max-concurrency each in-flight request holds a socket fd. The default soft RLIMIT_NOFILE (~1024) is exhausted client-side (EMFILE on socket()), so most requests fail before reaching the server and the run reports only ~one concurrency-wave of successes (e.g. ~919/10240 at conc=1024) while the server logs 200 OK for every request it actually receives. The server already calls set_ulimit() at startup; call it in the benchmark client too (soft is raised toward 65535, capped at the hard limit). --- atom/benchmarks/benchmark_serving.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atom/benchmarks/benchmark_serving.py b/atom/benchmarks/benchmark_serving.py index 35b4302c49..17a4d50cd9 100644 --- a/atom/benchmarks/benchmark_serving.py +++ b/atom/benchmarks/benchmark_serving.py @@ -686,6 +686,14 @@ def save_to_pytorch_benchmark_format( def main(args: argparse.Namespace): + # Raise the open-file soft limit before opening any connections. At high + # --max-concurrency each in-flight request is a socket (fd); the default + # RLIMIT_NOFILE soft (~1024) is exhausted client-side (EMFILE on socket()), + # silently dropping requests so most never reach the server. The server + # already calls set_ulimit() at startup; the client must too. + from atom.utils import set_ulimit + + set_ulimit() print(args) random.seed(args.seed) np.random.seed(args.seed)