mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
storage/backend: set initial db size to avoid potential deadlock
This commit is contained in:
parent
8156a58ba3
commit
26c645f049
@ -31,6 +31,11 @@ import (
|
||||
var (
|
||||
defaultBatchLimit = 10000
|
||||
defaultBatchInterval = 100 * time.Millisecond
|
||||
|
||||
// InitialMmapSize is the initial size of the mmapped region. Setting this larger than
|
||||
// the potential max db size can prevent writer from blocking reader.
|
||||
// This only works for linux.
|
||||
InitialMmapSize = 10 * 1024 * 1024 * 1024
|
||||
)
|
||||
|
||||
type Backend interface {
|
||||
|
@ -28,4 +28,7 @@ import (
|
||||
// package. If your kernel version is lower than 2.6.23
|
||||
// (https://github.com/torvalds/linux/releases/tag/v2.6.23), mmap might
|
||||
// silently ignore this flag. Please update your kernel to prevent this.
|
||||
var boltOpenOptions = &bolt.Options{MmapFlags: syscall.MAP_POPULATE}
|
||||
var boltOpenOptions = &bolt.Options{
|
||||
MmapFlags: syscall.MAP_POPULATE,
|
||||
InitialMmapSize: InitialMmapSize,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user