consul: Increase maximum number of parallel readers

This commit is contained in:
Armon Dadgar 2014-11-18 18:46:43 -08:00
parent 3b3f082283
commit e9c7b1df93
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ const (
dbACLs = "acls"
dbMaxMapSize32bit uint64 = 128 * 1024 * 1024 // 128MB maximum size
dbMaxMapSize64bit uint64 = 32 * 1024 * 1024 * 1024 // 32GB maximum size
dbMaxReaders uint = 4096 // 4K, default is 126
)
// kvMode is used internally to control which type of set
@ -163,6 +164,12 @@ func (s *StateStore) initialize() error {
return err
}
// Increase the maximum number of concurrent readers
// TODO: Block transactions if we could exceed dbMaxReaders
if err := s.env.SetMaxReaders(dbMaxReaders); err != nil {
return err
}
// Optimize our flags for speed over safety, since the Raft log + snapshots
// are durable. We treat this as an ephemeral in-memory DB, since we nuke
// the data anyways.