Skip to content

Commit

Permalink
Fix metric PotentialMaxThreadCount
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Kriukov committed Dec 21, 2023
1 parent 3afc4b1 commit 82be132
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ydb/library/actors/core/harmonizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,6 @@ void THarmonizer::HarmonizeImpl(ui64 ts) {
if (budget < -0.1) {
isStarvedPresent = true;
}
for (size_t poolIdx = 0; poolIdx < Pools.size(); ++poolIdx) {
TPoolInfo& pool = Pools[poolIdx];
AtomicSet(pool.PotentialMaxThreadCount, Min(pool.MaxThreadCount, budgetInt));
}
double overbooked = consumed - booked;
if (overbooked < 0) {
isStarvedPresent = false;
Expand Down Expand Up @@ -591,6 +587,11 @@ void THarmonizer::HarmonizeImpl(ui64 ts) {
pool.SetThreadCount(threadCount - 1);
}
}

for (size_t poolIdx = 0; poolIdx < Pools.size(); ++poolIdx) {
TPoolInfo& pool = Pools[poolIdx];
AtomicSet(pool.PotentialMaxThreadCount, std::min<i64>(pool.MaxThreadCount, pool.GetThreadCount() + budgetInt));
}
}

void THarmonizer::CalculatePriorityOrder() {
Expand Down

0 comments on commit 82be132

Please sign in to comment.