aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkruall <kruall@ydb.tech>2023-03-02 13:55:40 +0300
committerkruall <kruall@ydb.tech>2023-03-02 13:55:40 +0300
commitbdf36cf9059b73901dc09d667e2f2792380002b4 (patch)
treee3b6c1171959b0efd3f499d2cebd9fd39caf7d26
parent502e6daf19bdde912acdb7fff06f1e69e9ccfddf (diff)
downloadydb-bdf36cf9059b73901dc09d667e2f2792380002b4.tar.gz
Add in autoconfig grpc proxy count,
-rw-r--r--ydb/core/driver_lib/run/kikimr_services_initializers.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
index c72f09a6a8..d071e27eb0 100644
--- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
+++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
@@ -584,11 +584,12 @@ namespace {
constexpr i16 MaxPreparedCpuCount = 30;
constexpr i16 GRpcWorkerCountInMaxPreparedCpuCase = 4;
+ constexpr i16 GrpcProxyCountInMaxPreparedCpuCase = 4;
constexpr i16 CpuCountForEachGRpcWorker = MaxPreparedCpuCount / GRpcWorkerCountInMaxPreparedCpuCase;
+ constexpr i16 CpuCountForEachGRpcProxy = MaxPreparedCpuCount / GrpcProxyCountInMaxPreparedCpuCase;
constexpr i16 GRpcHandlersPerCompletionQueueInMaxPreparedCpuCase = 1000;
constexpr i16 GRpcHandlersPerCompletionQueuePerCpu = GRpcHandlersPerCompletionQueueInMaxPreparedCpuCase / MaxPreparedCpuCount;
-
TShortPoolCfg ComputeCpuTable[MaxPreparedCpuCount + 1][4] {
{ {0, 0}, {0, 0}, {0, 0}, {0, 0} }, // 0
{ {1, 1}, {0, 1}, {0, 1}, {0, 0} }, // 1
@@ -1817,9 +1818,12 @@ void TGRpcServicesInitializer::InitializeServices(NActors::TActorSystemSetup* se
if (!grpcConfig->HasWorkerThreads()) {
grpcConfig->SetWorkerThreads(Max(2, cpuCount / CpuCountForEachGRpcWorker));
}
- if (!grpcConfig->HasHandlersPerCompletionQueue()) {
+ if (!grpcConfig->HasHandlersPerCompletionQueue()) {
grpcConfig->SetHandlersPerCompletionQueue(GRpcHandlersPerCompletionQueuePerCpu * cpuCount);
}
+ if (!grpcConfig->HasGRpcProxyCount()) {
+ grpcConfig->SetGRpcProxyCount(Max(2, cpuCount / CpuCountForEachGRpcProxy));
+ }
}
if (!IsServiceInitialized(setup, NMsgBusProxy::CreateMsgBusProxyId())