Browse Source

consul: Increase maximum number of parallel readers

pull/481/merge
Armon Dadgar 10 years ago
parent
commit
e9c7b1df93
  1. 7
      consul/state_store.go

7
consul/state_store.go

@ -25,6 +25,7 @@ const (
dbACLs = "acls" dbACLs = "acls"
dbMaxMapSize32bit uint64 = 128 * 1024 * 1024 // 128MB maximum size dbMaxMapSize32bit uint64 = 128 * 1024 * 1024 // 128MB maximum size
dbMaxMapSize64bit uint64 = 32 * 1024 * 1024 * 1024 // 32GB 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 // kvMode is used internally to control which type of set
@ -163,6 +164,12 @@ func (s *StateStore) initialize() error {
return err 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 // 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 // are durable. We treat this as an ephemeral in-memory DB, since we nuke
// the data anyways. // the data anyways.

Loading…
Cancel
Save