File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ backend_send_bufsize = "128kb"
60
60
backend_send_timeout = " 30s"
61
61
62
62
# Set backend pipeline buffer size.
63
- backend_max_pipeline = 1024
63
+ backend_max_pipeline = 20480
64
64
65
65
# Set backend never read replica groups, default is false
66
66
backend_primary_only = false
Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ func (bc *BackendConn) loopWriter(round int) (err error) {
337
337
338
338
p := c .FlushEncoder ()
339
339
p .MaxInterval = time .Millisecond
340
- p .MaxBuffered = math2 . MinInt ( 256 , cap (tasks ))
340
+ p .MaxBuffered = cap (tasks ) / 2
341
341
342
342
for r := range bc .input {
343
343
if r .IsReadOnly () && r .IsBroken () {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ backend_send_bufsize = "128kb"
76
76
backend_send_timeout = "30s"
77
77
78
78
# Set backend pipeline buffer size.
79
- backend_max_pipeline = 1024
79
+ backend_max_pipeline = 20480
80
80
81
81
# Set backend never read replica groups, default is false
82
82
backend_primary_only = false
Original file line number Diff line number Diff line change @@ -197,11 +197,14 @@ func (s *Session) loopWriter(tasks *RequestChan) (err error) {
197
197
s .flushOpStats (true )
198
198
}()
199
199
200
- var breakOnFailure = s .config .SessionBreakOnFailure
200
+ var (
201
+ breakOnFailure = s .config .SessionBreakOnFailure
202
+ maxPipelineLen = s .config .SessionMaxPipeline
203
+ )
201
204
202
205
p := s .Conn .FlushEncoder ()
203
206
p .MaxInterval = time .Millisecond
204
- p .MaxBuffered = 256
207
+ p .MaxBuffered = maxPipelineLen / 2
205
208
206
209
return tasks .PopFrontAll (func (r * Request ) error {
207
210
resp , err := s .handleResponse (r )
You can’t perform that action at this time.
0 commit comments