From 00ce0702b933e93e8294d9e66911ef2319e2344d Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Tue, 25 Nov 2014 16:18:40 -0800 Subject: [PATCH] rafthttp: increase the size of streaming buffer Streaming buffer is used for: 1. hand over data to io goroutine in non-blocking way 2. hold pressure for temprorary network delay 3. be able to wait on I/O instead of data coming under high throughput The old 1024 value is too small and is very likely to be full and break the streaming when suffering temprorary network delay. --- rafthttp/streamer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rafthttp/streamer.go b/rafthttp/streamer.go index f7fe08b5b..fa788a3dc 100644 --- a/rafthttp/streamer.go +++ b/rafthttp/streamer.go @@ -34,7 +34,7 @@ import ( ) const ( - streamBufSize = 1024 + streamBufSize = 4096 ) type WriteFlusher interface {