From 0307759b9b10f1daec6fb0ab5cb980fb03dda390 Mon Sep 17 00:00:00 2001 From: Alisha Nanda Date: Thu, 5 Aug 2021 19:04:06 -0700 Subject: [PATCH] Fix OOM issues in qps tests (#26888) --- test/cpp/qps/server_async.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index f2d34bef842..d57e5a8c366 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -90,8 +90,12 @@ class AsyncQpsServerTest final : public grpc::testing::Server { int num_threads = config.async_server_threads(); if (num_threads <= 0) { // dynamic sizing - num_threads = cores(); - gpr_log(GPR_INFO, "Sizing async server to %d threads", num_threads); + num_threads = std::min(64, cores()); + gpr_log(GPR_INFO, + "Sizing async server to %d threads. Defaults to number of cores " + "in machine or 64 threads if machine has more than 64 cores to " + "avoid OOMs.", + num_threads); } int tpc = std::max(1, config.threads_per_cq()); // 1 if unspecified