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

Re-enable jemalloc's background thread by default (#9813) #9814

Merged
Merged
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
6 changes: 3 additions & 3 deletions dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ void UpdateMallocConfig([[maybe_unused]] const LoggerPtr & log)
RUN_FAIL_RETURN(je_mallctl("opt.background_thread", (void *)&old_b, &sz_b, nullptr, 0));
RUN_FAIL_RETURN(je_mallctl("opt.max_background_threads", (void *)&old_max_thd, &sz_st, nullptr, 0));

LOG_INFO(log, "Got jemalloc config: opt.background_thread {}, opt.max_background_threads {}", old_b, old_max_thd);

if (!malloc_conf && !old_b)
bool not_config_bg = !malloc_conf || strstr(malloc_conf, "background_thread") == nullptr;
if (not_config_bg && !old_b)
{
// If the user doesn't explicitly set the background_thread opt, and it is actually false, then set it to true.
LOG_INFO(log, "Try to use background_thread of jemalloc to handle purging asynchronously");

RUN_FAIL_RETURN(je_mallctl("max_background_threads", nullptr, nullptr, (void *)&new_max_thd, sz_st));
Expand Down