Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to 24-3: fix harmonizer logic with hoggish pools #9477

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ydb/library/actors/core/executor_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ namespace NActors {
class ISchedulerCookie;

struct TCpuConsumption {
double ConsumedUs = 0;
double BookedUs = 0;
double ElapsedUs = 0;
double CpuUs = 0;
ui64 NotEnoughCpuExecutions = 0;

void Add(const TCpuConsumption& other) {
ConsumedUs += other.ConsumedUs;
BookedUs += other.BookedUs;
ElapsedUs += other.ElapsedUs;
CpuUs += other.CpuUs;
NotEnoughCpuExecutions += other.NotEnoughCpuExecutions;
}
};
Expand Down
10 changes: 5 additions & 5 deletions ydb/library/actors/core/executor_pool_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ namespace NActors {
poolStats.DecreasingThreadsByHoggishState = stats.DecreasingThreadsByHoggishState;
poolStats.DecreasingThreadsByExchange = stats.DecreasingThreadsByExchange;
poolStats.PotentialMaxThreadCount = stats.PotentialMaxThreadCount;
poolStats.MaxConsumedCpuUs = stats.MaxConsumedCpu;
poolStats.MinConsumedCpuUs = stats.MinConsumedCpu;
poolStats.MaxBookedCpuUs = stats.MaxBookedCpu;
poolStats.MinBookedCpuUs = stats.MinBookedCpu;
poolStats.MaxElapsedCpuUs = stats.MaxElapsedCpu;
poolStats.MinElapsedCpuUs = stats.MinElapsedCpu;
poolStats.MaxCpuUs = stats.MaxCpu;
poolStats.MinCpuUs = stats.MinCpu;
}

statsCopy.resize(MaxFullThreadCount + 1);
Expand All @@ -430,7 +430,7 @@ namespace NActors {
void TBasicExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
if (Harmonizer) {
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
poolState.UsedCpu = stats.AvgConsumedCpu;
poolState.UsedCpu = stats.AvgElapsedCpu;
poolState.PossibleMaxLimit = stats.PotentialMaxThreadCount;
} else {
poolState.PossibleMaxLimit = poolState.MaxLimit;
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/actors/core/executor_pool_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ namespace NActors {

void TIOExecutorPool::GetCurrentStats(TExecutorPoolStats& poolStats, TVector<TExecutorThreadStats>& statsCopy) const {
poolStats.CurrentThreadCount = PoolThreads;
poolStats.DefaultThreadCount = PoolThreads;
poolStats.DefaultThreadCount = 0;
poolStats.MaxThreadCount = PoolThreads;
poolStats.PotentialMaxThreadCount = PoolThreads;
statsCopy.resize(PoolThreads + 1);
Expand All @@ -156,7 +156,7 @@ namespace NActors {
void TIOExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
if (Harmonizer) {
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
poolState.UsedCpu = stats.AvgConsumedCpu;
poolState.UsedCpu = stats.AvgElapsedCpu;
}
poolState.CurrentLimit = PoolThreads;
poolState.MaxLimit = PoolThreads;
Expand Down
8 changes: 4 additions & 4 deletions ydb/library/actors/core/executor_pool_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ void TSharedExecutorPool::GiveHalfThread(i16 from, i16 to) {
}

void TSharedExecutorPool::GetSharedStats(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
statsCopy.resize(SharedThreadCount + 1);
statsCopy.resize(SharedThreadCount);
for (i16 i = 0; i < SharedThreadCount; ++i) {
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i + 1]);
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i]);
}
}

void TSharedExecutorPool::GetSharedStatsForHarmonizer(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
statsCopy.resize(SharedThreadCount + 1);
statsCopy.resize(SharedThreadCount);
for (i16 i = 0; i < SharedThreadCount; ++i) {
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i + 1]);
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i]);
}
}

Expand Down
Loading
Loading