Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 3710d5c

Browse files
committed
Allow setting number of GC threads from command line
1 parent 19dcdfe commit 3710d5c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/common/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void PelotonInit::Initialize() {
5656
concurrency::EpochManagerFactory::GetInstance().StartEpoch();
5757

5858
// start GC.
59+
gc::GCManagerFactory::Configure(settings::SettingsManager::GetInt(settings::SettingId::gc_num_threads));
5960
gc::GCManagerFactory::GetInstance().StartGC();
6061

6162
// start index tuner

src/include/settings/settings.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ SETTING_int(monoqueue_worker_pool_size,
9999
// Number of connection threads used by peloton
100100
SETTING_int(connection_thread_count,
101101
"Number of connection threads (default: std::hardware_concurrency())",
102-
std::thread::hardware_concurrency(), false, false)
102+
std::thread::hardware_concurrency(),
103+
false, false)
104+
105+
SETTING_int(gc_num_threads,
106+
"The number of Garbage collection threads to run",
107+
1,
108+
true, true)
103109

104110
//===----------------------------------------------------------------------===//
105111
// WRITE AHEAD LOG

src/settings/settings_manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ const std::string SettingsManager::GetInfo() const {
116116
GetBool(SettingId::codegen) ? "enabled" : "disabled"));
117117
info.append(StringUtil::Format("%28s: %-28s\n", "Optimization Timeout",
118118
GetInt(SettingId::task_execution_timeout)));
119+
info.append(StringUtil::Format("%28s: %-28s\n", "Number of GC threads",
120+
GetInt(SettingId::gc_num_threads)));
119121
return StringBoxUtil::Box(info);
120122
}
121123

0 commit comments

Comments
 (0)