From b24d546bd0da1778e0f782a9832d537da482b375 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Sun, 7 Dec 2014 15:06:22 -0800 Subject: [PATCH] rafthttp: increase sender buffer size The buffer size is set big enough to buffer all messages generated in one second as a follower in good path. --- rafthttp/sender.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rafthttp/sender.go b/rafthttp/sender.go index 5a4d0b30b..f138fc2f4 100644 --- a/rafthttp/sender.go +++ b/rafthttp/sender.go @@ -32,7 +32,11 @@ import ( const ( connPerSender = 4 - senderBufSize = connPerSender * 4 + // senderBufSize is the size of sender buffer, which helps hold the + // temporary network latency. + // The size ensures that sender does not drop messages when the network + // is out of work for less than 1 second in good path. + senderBufSize = 64 appRespBatchMs = 50