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

Commit 3438f07

Browse files
authored
Merge branch 'master' into cleanup
2 parents c4ee33b + 0ad9bf3 commit 3438f07

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/common/init.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ namespace peloton {
3131
ThreadPool thread_pool;
3232

3333
void PelotonInit::Initialize() {
34-
CONNECTION_THREAD_COUNT = std::thread::hardware_concurrency();
34+
CONNECTION_THREAD_COUNT = settings::SettingsManager::GetInt(
35+
settings::SettingId::connection_thread_count);
3536
LOGGING_THREAD_COUNT = 1;
3637
GC_THREAD_COUNT = 1;
3738
EPOCH_THREAD_COUNT = 1;
3839

3940
// set max thread number.
40-
thread_pool.Initialize(0, std::thread::hardware_concurrency() + 3);
41+
thread_pool.Initialize(0, CONNECTION_THREAD_COUNT + 3);
4142

4243
// start worker pool
4344
threadpool::MonoQueuePool::GetInstance().Startup();
@@ -47,7 +48,7 @@ void PelotonInit::Initialize() {
4748
threadpool::MonoQueuePool::GetBrainInstance().Startup();
4849
}
4950

50-
int parallelism = (std::thread::hardware_concurrency() + 3) / 4;
51+
int parallelism = (CONNECTION_THREAD_COUNT + 3) / 4;
5152
storage::DataTable::SetActiveTileGroupCount(parallelism);
5253
storage::DataTable::SetActiveIndirectionArrayCount(parallelism);
5354

src/include/settings/settings.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ SETTING_int(monoqueue_worker_pool_size,
9797
4,
9898
false, false)
9999

100+
// Number of connection threads used by peloton
101+
SETTING_int(connection_thread_count,
102+
"Number of connection threads (default: std::hardware_concurrency())",
103+
std::thread::hardware_concurrency(), false, false)
104+
100105
//===----------------------------------------------------------------------===//
101106
// WRITE AHEAD LOG
102107
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)