Skip to content

Commit

Permalink
Fix metric PotentialMaxThreadCount (ydb-platform#629)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksandr Kriukov <kruall@ydb.ru>
  • Loading branch information
2 people authored and marsaly79 committed Dec 22, 2023
1 parent 2208cdd commit de89cc6
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 de89cc6

Please sign in to comment.