Skip to content

Commit

Permalink
Add 32 and 64bit specific sizes for InitialMmapSize
Browse files Browse the repository at this point in the history
  • Loading branch information
raskchanky committed Nov 17, 2021
1 parent e94bab3 commit 8d1a32d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions physical/raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -1667,9 +1667,7 @@ func boltOptions() (*bolt.Options, error) {
// so if users are wanting to turn this off, they can also set it to 0. Setting it
// to a negative value is the same as not setting it at all.
if os.Getenv("VAULT_RAFT_INITIAL_MMAP_SIZE") == "" {
if strconv.IntSize == 64 {
o.InitialMmapSize = 100 * 1024 * 1024 * 1024
}
o.InitialMmapSize = initialMmapSize
} else {
imms, err := strconv.Atoi(os.Getenv("VAULT_RAFT_INITIAL_MMAP_SIZE"))
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions physical/raft/vars_32bit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +build 386 arm

package raft

const initialMmapSize = 0
5 changes: 5 additions & 0 deletions physical/raft/vars_64bit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +build amd64 arm64 s390x

package raft

const initialMmapSize = 100 * 1024 * 1024 * 1024 // 100GB

0 comments on commit 8d1a32d

Please sign in to comment.