mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
7fc1795cdf
Refactor the ostweaks file to allows a more easy reuse Add a method on the osl.Sandbox interface to allow setting knobs on the sandbox Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
23 lines
536 B
Go
23 lines
536 B
Go
package overlay
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"github.com/docker/libnetwork/osl/kernel"
|
|
)
|
|
|
|
var ovConfig = map[string]*kernel.OSValue{
|
|
"net.ipv4.neigh.default.gc_thresh1": {"8192", checkHigher},
|
|
"net.ipv4.neigh.default.gc_thresh2": {"49152", checkHigher},
|
|
"net.ipv4.neigh.default.gc_thresh3": {"65536", checkHigher},
|
|
}
|
|
|
|
func checkHigher(val1, val2 string) bool {
|
|
val1Int, _ := strconv.ParseInt(val1, 10, 32)
|
|
val2Int, _ := strconv.ParseInt(val2, 10, 32)
|
|
return val1Int < val2Int
|
|
}
|
|
|
|
func applyOStweaks() {
|
|
kernel.ApplyOSTweaks(ovConfig)
|
|
}
|