diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-11-12 09:39:25 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-11-12 09:39:25 +0000 |
commit | cf5279392963e6ba305e895689a6c8999b63b414 (patch) | |
tree | 971f2777186f6a43b195b36e7660448c5527b574 /searchcore | |
parent | 434fca0b458910329f63da49b9b1c84de232bf3f (diff) |
Control the number of rpc threads and set it to #cores/4 instead of the fixed number of 48.
Diffstat (limited to 'searchcore')
3 files changed, 8 insertions, 5 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 85d44506565..fa7ea039798 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -331,7 +331,8 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) initializeThreads.reset(); _prepareRestartHandler = std::make_unique<PrepareRestartHandler>(*_flushEngine); - RPCHooks::Params rpcParams(*this, protonConfig.rpcport, _configUri.getConfigId()); + RPCHooks::Params rpcParams(*this, protonConfig.rpcport, _configUri.getConfigId(), + std::max(2u, hwInfo.cpu().cores()/4)); rpcParams.slobrok_config = _configUri.createWithNewId(protonConfig.slobrokconfigid); _rpcHooks = std::make_unique<RPCHooks>(rpcParams); _metricsEngine->addExternalMetrics(_rpcHooks->proto_rpc_adapter_metrics()); diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp index b5efea1de91..8c812928842 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp @@ -184,11 +184,12 @@ RPCHooksBase::initRPC() } -RPCHooksBase::Params::Params(Proton &parent, uint32_t port, const vespalib::string &ident) +RPCHooksBase::Params::Params(Proton &parent, uint32_t port, const vespalib::string &ident, uint32_t numThreads) : proton(parent), slobrok_config(config::ConfigUri("admin/slobrok.0")), identity(ident), - rtcPort(port) + rtcPort(port), + numRpcThreads(numThreads) { } RPCHooksBase::Params::~Params() = default; @@ -205,7 +206,7 @@ RPCHooksBase::RPCHooksBase(Params ¶ms) _regAPI(*_orb, slobrok::ConfiguratorFactory(params.slobrok_config)), _stateLock(), _stateCond(), - _executor(48, 128 * 1024, proton_rpc_executor) + _executor(params.numRpcThreads, 128 * 1024, proton_rpc_executor) { } void diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h index 494551c05bf..f8714a8aa13 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h @@ -87,8 +87,9 @@ public: config::ConfigUri slobrok_config; vespalib::string identity; uint32_t rtcPort; + uint32_t numRpcThreads; - Params(Proton &parent, uint32_t port, const vespalib::string &ident); + Params(Proton &parent, uint32_t port, const vespalib::string &ident, uint32_t numRpcThreads); ~Params(); }; RPCHooksBase(const RPCHooksBase &) = delete; |