Skip to content

Commit 2e3209e

Browse files
committed
Log the actual sizes of the thread pools
If one don't try to specify the actual number of threads in the thread pool one used to get a line saying that each thread pool was of size 0. Delay logging the size of the pools until we've started the thread pool and know the sizes as this saves us from guessing/calculating the actual thread pool sizes Change-Id: I3b99088e87e3ffccea0cb4dad23201b19d9318cb Reviewed-on: https://review.couchbase.org/c/kv_engine/+/190399 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent e8f87f8 commit 2e3209e

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

daemon/memcached.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,14 +648,6 @@ static void initialize_sasl() {
648648
static void startExecutorPool() {
649649
auto& settings = Settings::instance();
650650

651-
LOG_INFO(
652-
"Start executor pool with backend:Folly readers:{} writers:{} "
653-
"auxIO:{} nonIO:{}",
654-
settings.getNumReaderThreads(),
655-
settings.getNumWriterThreads(),
656-
settings.getNumAuxIoThreads(),
657-
settings.getNumNonIoThreads());
658-
659651
ExecutorPool::create(
660652
ExecutorPool::Backend::Folly,
661653
0,
@@ -666,6 +658,16 @@ static void startExecutorPool() {
666658
ExecutorPool::get()->registerTaskable(NoBucketTaskable::instance());
667659
ExecutorPool::get()->setDefaultTaskable(NoBucketTaskable::instance());
668660

661+
auto* pool = ExecutorPool::get();
662+
LOG_INFO(
663+
"Started executor pool with backend:{} readers:{} "
664+
"writers:{} auxIO:{} nonIO:{}",
665+
pool->getName(),
666+
pool->getNumReaders(),
667+
pool->getNumWriters(),
668+
pool->getNumAuxIO(),
669+
pool->getNumNonIO());
670+
669671
// MB-47484 Set up the settings callback for the executor pool now that
670672
// it is up'n'running
671673
settings.addChangeListener(

executor/cb3_executorpool.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ class CB3ExecutorPool : public ExecutorPool {
177177

178178
size_t getNumNonIO() override;
179179

180+
std::string_view getName() const override {
181+
return "CB3";
182+
}
183+
180184
void setNumReaders(ThreadPoolConfig::ThreadCount v) override {
181185
adjustWorkers(READER_TASK_IDX, calcNumReaders(v));
182186
}

executor/executorpool.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class ExecutorPool {
102102
/// @returns the number of Tasks ready to run.
103103
virtual size_t getNumReadyTasks() = 0;
104104

105+
/// @returns the name of the executor pool backed
106+
virtual std::string_view getName() const = 0;
107+
105108
/***************** Task Ownership ***************************************/
106109

107110
/**

executor/folly_executorpool.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ class FollyExecutorPool : public ExecutorPool {
168168
void setNumNonIO(uint16_t v) override;
169169
size_t getNumSleepers() override;
170170
size_t getNumReadyTasks() override;
171+
std::string_view getName() const override {
172+
return "Folly";
173+
}
171174

172175
void registerTaskable(Taskable& taskable) override;
173176
void unregisterTaskable(Taskable& taskable, bool force) override;

0 commit comments

Comments
 (0)