Pipe class instance weights over 17 KB in size, and most of it is used by
msgvec structure, which weights 16 KB. Reduce it to 4KB by reducing
number of iovecs in this array down to 256 (= 1024/4). This won't cause
noticeable perf decrease, as even under extreme loads, we exceed 256 used
iovecs in only less than 1% of all write calls. For high-density nodes and
large clusters, savings will exceed hundreds of megabytes per node.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
<< " writing " << donow
<< dendl;
- if (msg.msg_iovlen >= IOV_MAX-2) {
+ if (msg.msg_iovlen >= SM_IOV_MAX-2) {
if (do_sendmsg(&msg, msglen, true))
goto fail;
class IncomingQueue;
class DispatchQueue;
+static const int SM_IOV_MAX = (IOV_MAX >= 1024 ? IOV_MAX / 4 : IOV_MAX);
+
/**
* The Pipe is the most complex SimpleMessenger component. It gets
* two threads, one each for reading and writing on a socket it's handed
private:
int sd;
- struct iovec msgvec[IOV_MAX];
+ struct iovec msgvec[SM_IOV_MAX];
#if !defined(MSG_NOSIGNAL) && !defined(SO_NOSIGPIPE)
sigset_t sigpipe_mask;
bool sigpipe_pending;