[branch-2.1](memory) Refactor refresh workload groups weighted memory ratio and record refresh interval memory growth (#39760)

pick #38168
overwrites changes in #37221 on workload_group_manager.cpp. If need to
pick 37221, ignore it.
This commit is contained in:
Xinyi Zou
2024-08-22 17:33:11 +08:00
committed by GitHub
parent ba7baa7e6b
commit 8ce8887b75
30 changed files with 266 additions and 181 deletions

View File

@ -377,11 +377,11 @@ void Daemon::je_purge_dirty_pages_thread() const {
} while (true);
}
void Daemon::wg_mem_used_refresh_thread() {
// Refresh memory usage and limit of workload groups
void Daemon::wg_weighted_memory_ratio_refresh_thread() {
// Refresh weighted memory ratio of workload groups
while (!_stop_background_threads_latch.wait_for(
std::chrono::milliseconds(config::wg_mem_refresh_interval_ms))) {
doris::ExecEnv::GetInstance()->workload_group_mgr()->refresh_wg_memory_info();
std::chrono::milliseconds(config::wg_weighted_memory_ratio_refresh_interval_ms))) {
doris::ExecEnv::GetInstance()->workload_group_mgr()->refresh_wg_weighted_memory_ratio();
}
}
@ -420,7 +420,8 @@ void Daemon::start() {
CHECK(st.ok()) << st;
st = Thread::create(
"Daemon", "wg_mem_refresh_thread", [this]() { this->wg_mem_used_refresh_thread(); },
"Daemon", "wg_weighted_memory_ratio_refresh_thread",
[this]() { this->wg_weighted_memory_ratio_refresh_thread(); },
&_threads.emplace_back());
CHECK(st.ok()) << st;
}