raft: Set BatchApplyCh for more consistent batch sizes (#11907)
* raft: Set BatchApplyCh for more consistent batch sizes * Add changelog file
This commit is contained in:
parent
096a354626
commit
a794a6244f
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
raft: Improve raft batch size selection
|
||||
```
|
|
@ -671,6 +671,11 @@ func (b *RaftBackend) applyConfigSettings(config *raft.Config) error {
|
|||
config.NoSnapshotRestoreOnStart = true
|
||||
config.MaxAppendEntries = 64
|
||||
|
||||
// Setting BatchApplyCh allows the raft library to enqueue up to
|
||||
// MaxAppendEntries into each raft apply rather than relying on the
|
||||
// scheduler.
|
||||
config.BatchApplyCh = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue