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

Commit 0ad9bf3

Browse files
authored
Merge pull request #1179 from poojanilangekar/thread_count-setting
Modify init.cpp to fetch connection_thread_count setting
2 parents c15635b + c563340 commit 0ad9bf3

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,14 +31,15 @@ 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
MAX_CONCURRENCY = 10;
3940

4041
// set max thread number.
41-
thread_pool.Initialize(0, std::thread::hardware_concurrency() + 3);
42+
thread_pool.Initialize(0, CONNECTION_THREAD_COUNT + 3);
4243

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

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

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)