diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2023-10-31 15:30:31 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2023-11-02 11:17:24 +0000 |
commit | 10abf9db2a47091e151ca903e3675fae29c4ed09 (patch) | |
tree | b10feaaf88b3e5acd09dba87ed723a19befa9a31 /storageserver | |
parent | c87ae9ba1b1f1745191e75edefcaf436af3ab0c6 (diff) |
Wire HwInfo into MergeThrottler and use for auto-deduction of memory limits
Add config for min/max capping of deduced limit, as well as a scaling
factor based on the memory available to the process. Defaults
have been chosen based on empirical observations over many years,
but having these as config means we can tune things live if
it should ever be required.
Diffstat (limited to 'storageserver')
3 files changed, 9 insertions, 5 deletions
diff --git a/storageserver/src/vespa/storageserver/app/dummyservicelayerprocess.cpp b/storageserver/src/vespa/storageserver/app/dummyservicelayerprocess.cpp index 8940c2a320e..245afb1c774 100644 --- a/storageserver/src/vespa/storageserver/app/dummyservicelayerprocess.cpp +++ b/storageserver/src/vespa/storageserver/app/dummyservicelayerprocess.cpp @@ -7,7 +7,7 @@ namespace storage { // DummyServiceLayerProcess implementation DummyServiceLayerProcess::DummyServiceLayerProcess(const config::ConfigUri & configUri) - : ServiceLayerProcess(configUri) + : ServiceLayerProcess(configUri, vespalib::HwInfo()) { } diff --git a/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp b/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp index bb284bfc108..ebf320352eb 100644 --- a/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp +++ b/storageserver/src/vespa/storageserver/app/servicelayerprocess.cpp @@ -31,7 +31,7 @@ bucket_db_options_from_config(const config::ConfigUri& config_uri) { } -ServiceLayerProcess::ServiceLayerProcess(const config::ConfigUri& configUri) +ServiceLayerProcess::ServiceLayerProcess(const config::ConfigUri& configUri, const vespalib::HwInfo& hw_info) : Process(configUri), _externalVisitors(), _persistence_cfg_handle(), @@ -39,6 +39,7 @@ ServiceLayerProcess::ServiceLayerProcess(const config::ConfigUri& configUri) _filestor_cfg_handle(), _node(), _storage_chain_builder(), + _hw_info(hw_info), _context(std::make_unique<framework::defaultimplementation::RealClock>(), bucket_db_options_from_config(configUri)) { @@ -106,7 +107,8 @@ ServiceLayerProcess::createNode() sbc.visitor_cfg = _visitor_cfg_handle->getConfig(); sbc.filestor_cfg = _filestor_cfg_handle->getConfig(); - _node = std::make_unique<ServiceLayerNode>(_configUri, _context, std::move(sbc), *this, getProvider(), _externalVisitors); + _node = std::make_unique<ServiceLayerNode>(_configUri, _context, _hw_info, std::move(sbc), + *this, getProvider(), _externalVisitors); if (_storage_chain_builder) { _node->set_storage_chain_builder(std::move(_storage_chain_builder)); } diff --git a/storageserver/src/vespa/storageserver/app/servicelayerprocess.h b/storageserver/src/vespa/storageserver/app/servicelayerprocess.h index dcc56f373c4..add5a38ca9d 100644 --- a/storageserver/src/vespa/storageserver/app/servicelayerprocess.h +++ b/storageserver/src/vespa/storageserver/app/servicelayerprocess.h @@ -7,6 +7,7 @@ #include <vespa/storage/common/visitorfactory.h> #include <vespa/storage/storageserver/servicelayernodecontext.h> #include <vespa/storage/visiting/config-stor-visitor.h> +#include <vespa/vespalib/util/hw_info.h> namespace config { class ConfigUri; } @@ -29,14 +30,15 @@ private: std::unique_ptr<config::ConfigHandle<StorVisitorConfig>> _visitor_cfg_handle; std::unique_ptr<config::ConfigHandle<StorFilestorConfig>> _filestor_cfg_handle; - std::unique_ptr<ServiceLayerNode> _node; + std::unique_ptr<ServiceLayerNode> _node; std::unique_ptr<IStorageChainBuilder> _storage_chain_builder; protected: + vespalib::HwInfo _hw_info; ServiceLayerNodeContext _context; public: - explicit ServiceLayerProcess(const config::ConfigUri & configUri); + ServiceLayerProcess(const config::ConfigUri & configUri, const vespalib::HwInfo& hw_info); ~ServiceLayerProcess() override; void shutdown() override; |