aboutsummaryrefslogtreecommitdiffstats
path: root/yt
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-12-27 17:41:39 +0300
committerbabenko <babenko@yandex-team.com>2024-12-27 18:20:27 +0300
commitcc43ca8fe0180f9a217d97732b9444e607cd15c3 (patch)
tree38c67c36c1224a1acdf77f9dac0d36f12d9e5076 /yt
parent72f11ac227f69edb4de4358a51ace7cfbfcec7ee (diff)
downloadydb-cc43ca8fe0180f9a217d97732b9444e607cd15c3.tar.gz
Sleep for at least 1 ms between consequent throttler updates
commit_hash:872a1b88de2f08130a2cd67c81e21438a175f560
Diffstat (limited to 'yt')
-rw-r--r--yt/yt/core/concurrency/throughput_throttler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt/yt/core/concurrency/throughput_throttler.cpp b/yt/yt/core/concurrency/throughput_throttler.cpp
index c5a4e34ce6..51518b1cd4 100644
--- a/yt/yt/core/concurrency/throughput_throttler.cpp
+++ b/yt/yt/core/concurrency/throughput_throttler.cpp
@@ -448,7 +448,8 @@ private:
YT_VERIFY(limit >= 0);
// Reconfigure clears the update cookie, so infinity is fine.
- auto delay = limit ? TDuration::MilliSeconds(Max<i64>(0, -Available_ * 1000 / limit)) : TDuration::Max();
+ // NB: Cap by 1 ms from below to somewhat limit the wakeup rate.
+ auto delay = limit ? TDuration::MilliSeconds(Max<i64>(1, -Available_ * 1000 / limit)) : TDuration::Max();
UpdateCookie_ = TDelayedExecutor::Submit(
BIND_NO_PROPAGATE(&TReconfigurableThroughputThrottler::Update, MakeWeak(this)),