Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel default values (sysctl) #4654

Open
sergelogvinov opened this issue Dec 6, 2021 · 4 comments
Open

Kernel default values (sysctl) #4654

sergelogvinov opened this issue Dec 6, 2021 · 4 comments

Comments

@sergelogvinov
Copy link
Sponsor Contributor

Feature Request

Linux kernel has many default params. And a few of it not good for kubernetes usage.
AWS/GCP and other modify kernel params at boot time.
Talos changes only security values.

So, to make better user experience Talos can set/change common values too.

For example:

# kube-proxy chenge it by default, but cilium is not. Default values can drop connection between pods.
net.ipv4.tcp_keepalive_time: 600
net.ipv4.tcp_keepalive_intvl: 60

# kubelet has 110 pod limit by default, and pod can have more then one container. This value covers many common cases.
fs.inotify.max_user_instances: 256

In my setup, i have about 30-lines kernel sysctl changes. Not all of them good for all setups, but we can learn from other kubernetes solutions...

@smira
Copy link
Member

smira commented Dec 8, 2021

Planning Meeting Notes

Looks good, we'd like to see all 30 lines and discuss which are good. 👍

@sergelogvinov
Copy link
Sponsor Contributor Author

net.ipv4.tcp_keepalive_time: 600
net.ipv4.tcp_keepalive_intvl: 60

fs.inotify.max_user_instances: 512

net.core.somaxconn: 65535
net.core.netdev_max_backlog: 4096 
net.core.wmem_max: 524288
net.core.rmem_max: 524288

net.ipv4.tcp_mem: "65536 131072 262144"
net.ipv4.tcp_rmem: "8192 87380 16777216"
net.ipv4.tcp_wmem: "8192 65536 16777216"
net.ipv4.tcp_max_tw_buckets: 32768
net.ipv4.udp_mem: "65536 131072 262144"
net.ipv4.udp_rmem_min: 16384
net.ipv4.udp_wmem_min: 16384

net.ipv4.tcp_max_syn_backlog: 20480
net.ipv4.tcp_timestamps: 0
net.ipv4.ip_local_port_range: "1025       65535"

vm.max_map_count: 262144
vm.overcommit_memory: 1
vm.swappiness: 1

fs.file-max: 1048576
fs.nr_open: 1048576

@Davincible
Copy link
Contributor

Since this issue is mentioned in the Cilium docs, which parameters exactly are good to change for use with Cilium? I see the first 3 in the original issue have already been merged with defaults

@smira
Copy link
Member

smira commented Jun 21, 2022

I think the ones which are safe to set in general are already set, others might need testing with your environment to see whether they're good or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants