summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-03-16 10:00:57 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-03-16 10:05:54 +0000
commitbdd516c3396fd5465c3c2ebf742cfadf20d8a8b1 (patch)
treea6f64d034574924da31104dfea80b8e30b3221fc /searchcore
parent57c6e83ea0b519397429df3f2230a8ec336f778f (diff)
Follow the config for executors also for index and summary.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
index f218193c02f..3147542729f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
@@ -9,6 +9,7 @@
#include <vespa/vespalib/util/singleexecutor.h>
using vespalib::BlockingThreadStackExecutor;
+using vespalib::ThreadStackExecutor;
using vespalib::CpuUsage;
using vespalib::SequencedTaskExecutor;
using vespalib::SingleExecutor;
@@ -21,12 +22,16 @@ namespace proton {
namespace {
std::unique_ptr<SyncableThreadExecutor>
-createExecutorWithOneThread(uint32_t taskLimit, OptimizeFor optimize,
- vespalib::Runnable::init_fun_t init_function) {
- if (optimize == OptimizeFor::THROUGHPUT) {
- return std::make_unique<SingleExecutor>(std::move(init_function), taskLimit);
+createExecutorWithOneThread(const ThreadingServiceConfig & cfg, vespalib::Runnable::init_fun_t init_function) {
+ uint32_t taskLimit = cfg.defaultTaskLimit();
+ if (cfg.optimize() == OptimizeFor::THROUGHPUT) {
+ return std::make_unique<SingleExecutor>(std::move(init_function), taskLimit, cfg.is_task_limit_hard(), taskLimit/10, 100ms);
} else {
- return std::make_unique<BlockingThreadStackExecutor>(1, taskLimit, std::move(init_function));
+ if (cfg.is_task_limit_hard()) {
+ return std::make_unique<BlockingThreadStackExecutor>(1, taskLimit, std::move(init_function));
+ } else {
+ return std::make_unique<ThreadStackExecutor>(1, std::move(init_function));
+ }
}
}
@@ -55,10 +60,8 @@ ExecutorThreadingService::ExecutorThreadingService(vespalib::Executor & sharedEx
_clock(clock),
_masterExecutor(1, CpuUsage::wrap(master_executor, CpuUsage::Category::WRITE)),
_master_task_limit(cfg.master_task_limit()),
- _indexExecutor(createExecutorWithOneThread(cfg.defaultTaskLimit(), cfg.optimize(),
- CpuUsage::wrap(index_executor, CpuUsage::Category::WRITE))),
- _summaryExecutor(createExecutorWithOneThread(cfg.defaultTaskLimit(), cfg.optimize(),
- CpuUsage::wrap(summary_executor, CpuUsage::Category::WRITE))),
+ _indexExecutor(createExecutorWithOneThread(cfg, CpuUsage::wrap(index_executor, CpuUsage::Category::WRITE))),
+ _summaryExecutor(createExecutorWithOneThread(cfg, CpuUsage::wrap(summary_executor, CpuUsage::Category::WRITE))),
_masterService(_masterExecutor),
_indexService(*_indexExecutor),
_index_field_inverter(field_writer),