Skip to content

Commit

Permalink
buffer applyCh with up to conf.MaxAppendEntries
Browse files Browse the repository at this point in the history
This change improves throughput in busy Raft clusters.
By buffering messages, individual RPCs contain more Raft messages.
In my tests, this improves throughput from about 4.5 kqps to about 5.5 kqps.
  • Loading branch information
stapelberg authored Jun 14, 2016
1 parent 4bcac2a commit 05314fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func NewRaft(conf *Config, fsm FSM, logs LogStore, stable StableStore, snaps Sna

// Create Raft struct
r := &Raft{
applyCh: make(chan *logFuture),
applyCh: make(chan *logFuture, conf.MaxAppendEntries),
conf: conf,
fsm: fsm,
fsmCommitCh: make(chan commitTuple, 128),
Expand Down

0 comments on commit 05314fd

Please sign in to comment.