diff options
author | Vitalii Gridnev <gridnevvvit@gmail.com> | 2022-03-25 18:41:53 +0300 |
---|---|---|
committer | Vitalii Gridnev <gridnevvvit@gmail.com> | 2022-03-25 18:41:53 +0300 |
commit | 8834e9b5eaf11c7bd24b137ce3ed700653be911b (patch) | |
tree | 7ecfe2ba6312a0bb3682710988f187aa1d380406 | |
parent | 2e3aab17aaa8538c0ed662ef2adc4a085d74b67d (diff) | |
download | ydb-8834e9b5eaf11c7bd24b137ce3ed700653be911b.tar.gz |
[kqp] increase lookup interval and introduce new config option KIKIMR-14574
ref:c7c7d77eba3ca362120b2192d3189e6f56577107
-rw-r--r-- | ydb/core/kqp/proxy/kqp_proxy_service.cpp | 13 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ydb/core/kqp/proxy/kqp_proxy_service.cpp b/ydb/core/kqp/proxy/kqp_proxy_service.cpp index dea435aacd..a20e1a8c42 100644 --- a/ydb/core/kqp/proxy/kqp_proxy_service.cpp +++ b/ydb/core/kqp/proxy/kqp_proxy_service.cpp @@ -51,8 +51,6 @@ TString MakeKqpProxyBoardPath(const TString& database) { static constexpr TDuration DEFAULT_KEEP_ALIVE_TIMEOUT = TDuration::MilliSeconds(5000); static constexpr TDuration DEFAULT_EXTRA_TIMEOUT_WAIT = TDuration::MilliSeconds(10); -static constexpr TDuration DEFAULT_PUBLISH_BATCHING_INTERVAL = TDuration::MilliSeconds(1000); -static constexpr TDuration DEFAUL_BOARD_LOOKUP_INTERVAL = TDuration::MilliSeconds(5000); static constexpr TDuration DEFAULT_CREATE_SESSION_TIMEOUT = TDuration::MilliSeconds(5000); @@ -424,10 +422,12 @@ public: return; } + const auto& sbs = TableServiceConfig.GetSessionBalancerSettings(); auto now = TAppData::TimeProvider->Now(); - if (LastPublishResourcesAt && now - *LastPublishResourcesAt < DEFAULT_PUBLISH_BATCHING_INTERVAL) { + TDuration batchingInterval = TDuration::MilliSeconds(sbs.GetBoardPublishIntervalMs()); + if (LastPublishResourcesAt && now - *LastPublishResourcesAt < batchingInterval) { ResourcesPublishScheduled = true; - Schedule(DEFAULT_PUBLISH_BATCHING_INTERVAL, new TEvPrivate::TEvReadyToPublishResources()); + Schedule(batchingInterval, new TEvPrivate::TEvReadyToPublishResources()); return; } @@ -777,7 +777,10 @@ public: Y_UNUSED(ev); LookupPeerProxyData(); if (!ShutdownRequested) { - Schedule(DEFAUL_BOARD_LOOKUP_INTERVAL, new TEvPrivate::TEvCollectPeerProxyData()); + const auto& sbs = TableServiceConfig.GetSessionBalancerSettings(); + ui64 millis = sbs.GetBoardLookupIntervalMs(); + TDuration d = TDuration::MilliSeconds(millis + (RandomProvider->GenRand() % millis)); + Schedule(d, new TEvPrivate::TEvCollectPeerProxyData()); } } diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index 6b1257e319..ebc7d0eaa3 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1054,6 +1054,9 @@ message TTableServiceConfig { optional bool LocalDatacenterPolicy = 8 [default = true]; optional double MinCpuBalancerThreshold = 9 [default = 0.5]; + + optional uint32 BoardPublishIntervalMs = 10 [default = 1000]; + optional uint32 BoardLookupIntervalMs = 11 [default = 30000]; } message TQueryReplayConfig { |