diff options
5 files changed, 27 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorVisitorProducer.java b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorVisitorProducer.java index ec93881aae7..748fd7ab04e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorVisitorProducer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorVisitorProducer.java @@ -1,13 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.content.storagecluster; +import com.yahoo.vespa.config.content.StorFilestorConfig; import com.yahoo.vespa.config.content.core.StorVisitorConfig; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; /** * Serves stor-visitor config for storage clusters. */ -public class StorVisitorProducer implements StorVisitorConfig.Producer { +public class StorVisitorProducer implements StorVisitorConfig.Producer, StorFilestorConfig.Producer { public static class Builder { public StorVisitorProducer build(ModelElement element) { ModelElement tuning = element.child("tuning"); @@ -42,6 +43,13 @@ public class StorVisitorProducer implements StorVisitorConfig.Producer { } @Override + public void getConfig(StorFilestorConfig.Builder builder) { + if (threadCount != null) { + builder.num_visitor_threads(threadCount); + } + } + + @Override public void getConfig(StorVisitorConfig.Builder builder) { if (threadCount != null) { builder.visitorthreads(threadCount); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java index 88b6833221d..035c69a5bd4 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java @@ -121,6 +121,7 @@ public class StorageCluster extends AbstractConfigProducer<StorageNode> @Override public void getConfig(StorFilestorConfig.Builder builder) { fileStorProducer.getConfig(builder); + storVisitorProducer.getConfig(builder); } } diff --git a/configdefinitions/src/vespa/stor-filestor.def b/configdefinitions/src/vespa/stor-filestor.def index bab19c923d9..e9165f5adc9 100644 --- a/configdefinitions/src/vespa/stor-filestor.def +++ b/configdefinitions/src/vespa/stor-filestor.def @@ -31,7 +31,12 @@ num_threads int default=8 restart ## Negative number will choose a good number based on # cores. num_response_threads int default=2 restart -## Number of handler objects that might be created by networkthreads +## Number of handler objects that might be created by visitor threads +## This is a temporary setting that only skilled vespa developers should modify +## This must be kept in line with stor-visitor:visitorthreads +num_visitor_threads int default=16 restart + +## Number of handler objects that might be created by network threads ## This is a temporary setting that only skilled vespa developers should modify ## This must be kept in line with stor-communicationmanager:rpc.num_network_threads num_network_threads int default=1 restart diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp index c1c412fefeb..ef40929cb88 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp @@ -91,9 +91,8 @@ FileStorManager::~FileStorManager() } void -FileStorManager::print(std::ostream& out, bool verbose, const std::string& indent) const +FileStorManager::print(std::ostream& out, bool , const std::string& ) const { - (void) verbose; (void) indent; out << "FileStorManager"; } @@ -124,6 +123,14 @@ selectSequencer(vespa::config::content::StorFilestorConfig::ResponseSequencerTyp thread_local PersistenceHandler * _G_threadLocalHandler TLS_LINKAGE = nullptr; +size_t +computeAllPossibleHandlerThreads(const vespa::config::content::StorFilestorConfig & cfg) { + return cfg.numThreads + + computeNumResponseThreads(cfg.numResponseThreads) + + cfg.numNetworkThreads + + cfg.numVisitorThreads; +} + } PersistenceHandler & @@ -165,7 +172,7 @@ FileStorManager::configure(std::unique_ptr<vespa::config::content::StorFilestorC size_t numThreads = _config->numThreads; size_t numStripes = std::max(size_t(1u), numThreads / 2); _metrics->initDiskMetrics(_component.getLoadTypes()->getMetricLoadTypes(), numStripes, - numThreads + _config->numResponseThreads + _config->numNetworkThreads); + computeAllPossibleHandlerThreads(*_config)); _filestorHandler = std::make_unique<FileStorHandlerImpl>(numThreads, numStripes, *this, *_metrics, _compReg); uint32_t numResponseThreads = computeNumResponseThreads(_config->numResponseThreads); diff --git a/storage/src/vespa/storage/visiting/stor-visitor.def b/storage/src/vespa/storage/visiting/stor-visitor.def index 72b3699fe2d..ef3c0cd6113 100644 --- a/storage/src/vespa/storage/visiting/stor-visitor.def +++ b/storage/src/vespa/storage/visiting/stor-visitor.def @@ -2,6 +2,7 @@ namespace=vespa.config.content.core ## Number of separate threads that runs visitors. +## Keep in sync with #stor-filestor:num_visitor_threads visitorthreads int default=16 restart ## Default timeout of visitors that loses contact with client (in seconds) |