mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
format messages and change mmap comparison logic
This commit is contained in:
parent
3809fe6734
commit
3982a8e970
1 changed files with 5 additions and 6 deletions
|
|
@ -24,7 +24,6 @@ import (
|
|||
"context"
|
||||
"crypto/tls"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"math/rand"
|
||||
|
|
@ -155,13 +154,13 @@ func (m *Command) Start() (err error) {
|
|||
return errors.Wrap(err, "setting up server")
|
||||
}
|
||||
|
||||
cmd, err := exec.Command("sysctl", "vm.max_map_count").Output()
|
||||
data := binary.BigEndian.Uint64(cmd)
|
||||
result, err := exec.Command("sysctl", "vm.max_map_count").Output()
|
||||
if err != nil {
|
||||
fmt.Println("Error: ", err)
|
||||
m.logger.Printf("Tried unsuccessfully to check system mmap limit: %v", err)
|
||||
} else {
|
||||
if m.Config.MaxMapCount >= data {
|
||||
m.logger.Printf("grpc server error: Config max map limit (%v) is greater than current system limits (%v)", m.Config.MaxMapCount, data)
|
||||
sysMmapLimit := binary.BigEndian.Uint64(result)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue