aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetwork.cpp1
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetworkparams.cpp1
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetworkparams.h8
-rw-r--r--storage/src/vespa/storage/config/stor-communicationmanager.def2
-rw-r--r--storage/src/vespa/storage/storageserver/communicationmanager.cpp1
5 files changed, 13 insertions, 0 deletions
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
index ae427a74d27..4b498c4c014 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
@@ -130,6 +130,7 @@ RPCNetwork::RPCNetwork(const RPCNetworkParams &params) :
{
_transport->SetMaxInputBufferSize(params.getMaxInputBufferSize());
_transport->SetMaxOutputBufferSize(params.getMaxOutputBufferSize());
+ _transport->SetTCPNoDelay(params.getTcpNoDelay());
}
RPCNetwork::~RPCNetwork()
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetworkparams.cpp b/messagebus/src/vespa/messagebus/network/rpcnetworkparams.cpp
index bd87e4dbbe2..5bf277a8ee6 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetworkparams.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcnetworkparams.cpp
@@ -15,6 +15,7 @@ RPCNetworkParams::RPCNetworkParams(config::ConfigUri configUri) :
_maxInputBufferSize(256*1024),
_maxOutputBufferSize(256*1024),
_numThreads(4),
+ _tcpNoDelay(true),
_dispatchOnEncode(true),
_dispatchOnDecode(false),
_connectionExpireSecs(600),
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetworkparams.h b/messagebus/src/vespa/messagebus/network/rpcnetworkparams.h
index ba530257030..140f81c611c 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetworkparams.h
+++ b/messagebus/src/vespa/messagebus/network/rpcnetworkparams.h
@@ -20,6 +20,7 @@ private:
uint32_t _maxInputBufferSize;
uint32_t _maxOutputBufferSize;
uint32_t _numThreads;
+ bool _tcpNoDelay;
bool _dispatchOnEncode;
bool _dispatchOnDecode;
double _connectionExpireSecs;
@@ -106,6 +107,13 @@ public:
uint32_t getNumThreads() const { return _numThreads; }
+ RPCNetworkParams &setTcpNoDelay(bool tcpNoDelay) {
+ _tcpNoDelay = tcpNoDelay;
+ return *this;
+ }
+
+ bool getTcpNoDelay() const { return _tcpNoDelay; }
+
/**
* Returns the number of seconds before an idle network connection expires.
*
diff --git a/storage/src/vespa/storage/config/stor-communicationmanager.def b/storage/src/vespa/storage/config/stor-communicationmanager.def
index 2a2a840dd4e..f05d9eca7e4 100644
--- a/storage/src/vespa/storage/config/stor-communicationmanager.def
+++ b/storage/src/vespa/storage/config/stor-communicationmanager.def
@@ -33,6 +33,8 @@ mbus.rpctargetcache.ttl double default = 600
## Any value below 1 will be 1.
mbus.num_threads int default=4
+mbus.optimization enum {LATENCY, THROUGHPUT} default = LATENCY
+
## Enable to use above thread pool for encoding replies
## False will use network(fnet) thread
mbus.dispatch_on_encode bool default=true
diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
index 978d434847e..78d2c9f9c21 100644
--- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp
+++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
@@ -415,6 +415,7 @@ void CommunicationManager::configure(std::unique_ptr<CommunicationManagerConfig>
params.setNumThreads(std::max(1, config->mbus.numThreads));
params.setDispatchOnDecode(config->mbus.dispatchOnDecode);
params.setDispatchOnEncode(config->mbus.dispatchOnEncode);
+ params.setTcpNoDelay(config->mbus.optimization == CommunicationManagerConfig::Mbus::Optimization::LATENCY);
params.setIdentity(mbus::Identity(_component.getIdentity()));
if (config->mbusport != -1) {