mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 19:37:51 +00:00
Merge pull request #1368 from Maxtonian/mmap
Mmap limit comparison warning message for Linux
This commit is contained in:
commit
4b33a7fe16
2 changed files with 17 additions and 1 deletions
2
lattice
2
lattice
|
|
@ -1 +1 @@
|
|||
Subproject commit 36f453c1ea3bf86c546a8ad4a88f2a926724d683
|
||||
Subproject commit 28c2313ecfcd7e083d42d4e409483e968b4c421b
|
||||
|
|
@ -24,6 +24,7 @@ import (
|
|||
"context"
|
||||
"crypto/tls"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net"
|
||||
|
|
@ -31,6 +32,7 @@ import (
|
|||
"os/signal"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
|
@ -152,6 +154,20 @@ func (m *Command) Start() (err error) {
|
|||
return errors.Wrap(err, "setting up server")
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
result, err := ioutil.ReadFile("/proc/sys/vm/max_map_count")
|
||||
if err != nil {
|
||||
m.logger.Printf("Tried unsuccessfully to check system mmap limit: %v", err)
|
||||
} else {
|
||||
sysMmapLimit, err := strconv.ParseUint(strings.TrimSuffix(string(result), "\n"), 10, 64)
|
||||
if err != nil {
|
||||
m.logger.Printf("Tried unsuccessfully to check system mmap limit: %v", err)
|
||||
} else if m.Config.MaxMapCount > sysMmapLimit {
|
||||
m.logger.Printf("WARNING: Config max map limit (%v) is greater than current system limits (%v)", m.Config.MaxMapCount, sysMmapLimit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set up networking (i.e. gossip)
|
||||
err = m.setupNetworking()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue