aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/server_builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/server_builder.h')
-rw-r--r--include/grpc++/server_builder.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index 0888bef0d9..bf842baf6f 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -202,7 +202,10 @@ class ServerBuilder {
struct SyncServerSettings {
SyncServerSettings()
- : num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {}
+ : num_cqs(GPR_MAX(1, gpr_cpu_num_cores())),
+ min_pollers(1),
+ max_pollers(2),
+ cq_timeout_msec(10000) {}
/// Number of server completion queues to create to listen to incoming RPCs.
int num_cqs;