Skip to content

Commit

Permalink
feat: sysctl system optimization
Browse files Browse the repository at this point in the history
This PR changes most common tweaks.

* inotify uses for reload config files if it changed
* tcp_keepalive_* helps to refrech tcp state connections

Signed-off-by: Serge Logvinov <[email protected]>
Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
sergelogvinov authored and smira committed Feb 10, 2022
1 parent 8b6d622 commit cbc9610
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,29 @@ func (ctrl *KernelParamDefaultsController) getKernelParams() []*kernel.Param {
Key: "net.ipv6.conf.default.accept_ra",
Value: "2",
},
// ipvs/conntrack tcp keepalive refresh.
{
Key: "net.ipv4.tcp_keepalive_time",
Value: "600",
},
{
Key: "net.ipv4.tcp_keepalive_intvl",
Value: "60",
},
{
Key: "kernel.pid_max",
Value: "262144",
},
}...)

// kernel optimization for kubernetes workloads.
res = append(res, []*kernel.Param{
// configs inotify.
{
Key: "fs.inotify.max_user_instances",
Value: "512",
},
}...)

return res
}

0 comments on commit cbc9610

Please sign in to comment.