浏览代码

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.
Yicheng Qin 11 年之前
父节点
当前提交
00ce0702b9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rafthttp/streamer.go

+ 1 - 1
rafthttp/streamer.go

@@ -34,7 +34,7 @@ import (
 )
 )
 
 
 const (
 const (
-	streamBufSize = 1024
+	streamBufSize = 4096
 )
 )
 
 
 type WriteFlusher interface {
 type WriteFlusher interface {