From 768d0b3b3f53119bf6c2936538d642f45bbc3a02 Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Thu, 12 Mar 2020 12:05:30 -0700 Subject: [PATCH] Allocate a buffer of 100 calls for each RPC handler (#7573) --- src/ray/rpc/grpc_server.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ray/rpc/grpc_server.cc b/src/ray/rpc/grpc_server.cc index 7c0e35e26..8de493c09 100644 --- a/src/ray/rpc/grpc_server.cc +++ b/src/ray/rpc/grpc_server.cc @@ -66,7 +66,12 @@ void GrpcServer::Run() { // Create calls for all the server call factories. for (auto &entry : server_call_factories_) { for (int i = 0; i < num_threads_; i++) { - entry->CreateCall(); + // Create a buffer of 100 calls for each RPC handler. + // TODO(edoakes): a small buffer should be fine and seems to have better + // performance, but we don't currently handle backpressure on the client. + for (int j = 0; j < 100; j++) { + entry->CreateCall(); + } } } // Start threads that polls incoming requests.