Skip to content

Commit 4cd2a8c

Browse files
committed
[FAB-5153] Relax gossip send buffer behavior
In gossip there are send and receive buffers that are allocated for each connection. When the throughput of messages is too high and the send buffer overflows, the connection to the peer is closed and the peer is removed from the membership. From performance evaluations I did - I conclude that: - Increasing the send buffer size would benefit to withstand intense bursts of messages, even when the receive buffer stays the same. - Not closing the connection to the peer (and not removing it from the membership) that its corresponding send buffer overflowed helps the throughput by giving the runtime an opportunity to recover in spite of an intensive burst. Change-Id: I7bc84092e366b75b6cbcaee1ea9d5320274dfc1c Signed-off-by: yacovm <[email protected]>
1 parent bdd4a96 commit 4cd2a8c

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

gossip/comm/comm_impl.go

-3
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ const (
4545
defConnTimeout = time.Second * time.Duration(2)
4646
defRecvBuffSize = 20
4747
defSendBuffSize = 20
48-
sendOverflowErr = "Send buffer overflow"
4948
)
5049

51-
var errSendOverflow = errors.New(sendOverflowErr)
52-
5350
// SetDialTimeout sets the dial timeout
5451
func SetDialTimeout(timeout time.Duration) {
5552
viper.Set("peer.gossip.dialTimeout", timeout)

gossip/comm/comm_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func TestViperConfig(t *testing.T) {
195195
assert.Equal(t, time.Duration(2)*time.Second, util.GetDurationOrDefault("peer.gossip.connTimeout", 0))
196196
assert.Equal(t, time.Duration(300)*time.Millisecond, util.GetDurationOrDefault("peer.gossip.dialTimeout", 0))
197197
assert.Equal(t, 20, util.GetIntOrDefault("peer.gossip.recvBuffSize", 0))
198-
assert.Equal(t, 20, util.GetIntOrDefault("peer.gossip.sendBuffSize", 0))
198+
assert.Equal(t, 200, util.GetIntOrDefault("peer.gossip.sendBuffSize", 0))
199199
}
200200

201201
func TestHandshake(t *testing.T) {

gossip/comm/conn.go

-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ func (conn *connection) send(msg *proto.SignedGossipMessage, onErr func(error))
260260
defer conn.Unlock()
261261

262262
if len(conn.outBuff) == util.GetIntOrDefault("peer.gossip.sendBuffSize", defSendBuffSize) {
263-
go onErr(errSendOverflow)
264263
return
265264
}
266265

sampleconfig/core.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ peer:
162162
# Buffer size of received messages
163163
recvBuffSize: 20
164164
# Buffer size of sending messages
165-
sendBuffSize: 20
165+
sendBuffSize: 200
166166
# Time to wait before pull engine processes incoming digests (unit: second)
167167
digestWaitTime: 1s
168168
# Time to wait before pull engine removes incoming nonce (unit: second)

0 commit comments

Comments
 (0)