diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-16 14:29:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 14:29:34 +0100 |
commit | efae0a4b284104bbcea4b27ea7db82a25ef0bd25 (patch) | |
tree | be867d447748651126eb08c8db7742f28344f1b8 /searchcore | |
parent | e3ecafe1d3a2793b0c6f937b4925be6054769f49 (diff) | |
parent | 0447c0fdb822ddf603235836b30068337605a723 (diff) |
Merge pull request #26459 from vespa-engine/balder/follow-config-of-tasklimit
Follow the config for executors also for index and summary.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp | 22 |
1 files changed, 13 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..4798ebd8fbc 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,17 @@ 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) { + uint32_t watermark = (cfg.kindOfwatermark() == 0) ? taskLimit / 10 : cfg.kindOfwatermark(); + return std::make_unique<SingleExecutor>(std::move(init_function), taskLimit, cfg.is_task_limit_hard(), watermark, 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 +61,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), |