K8s[内核优化]-大规模下集群优化
最大线程数和文件打开数。
编辑 /etc/security/limits.conf 。
root soft nofile 655350 root hard nofile 655350 root soft nproc 655350 root hard nproc 655350 * soft nofile 655350 * hard nofile 655350 * soft nproc 655350 * hard nproc 655350
|
内核优化,重点优化以下参数。
编辑 /etc/sysctl.conf
net.netfilter.nf_conntrack_tcp_be_liberal = 1 net.netfilter.nf_conntrack_tcp_loose = 1 net.netfilter.nf_conntrack_max = 3200000 net.netfilter.nf_conntrack_buckets = 1600512 net.netfilter.nf_conntrack_tcp_timeout_time_wait = 30 net.netfilter.nf_conntrack_tcp_timeout_established = 1200
net.ipv4.tcp_syncookies = 1 net.core.somaxconn = 4096 net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.ip_local_port_range = "1024 65000"
net.ipv4.tcp_max_tw_buckets = 50000 net.ipv4.tcp_fin_timeout = 30
net.ipv4.neigh.default.gc_thresh1="2048" net.ipv4.neigh.default.gc_thresh2="4096" net.ipv4.neigh.default.gc_thresh3="8192"
vm.dirty_background_ratio = 5 vm.dirty_expire_centisecs = 300 vm.dirty_ratio = 10 vm.dirty_writeback_centisecs = 50 vm.dirtytime_expire_seconds = 43200
fs.file-max=655360 fs.inotify.max_user_instances="8192" fs.inotify.max_user_watches="524288"
kernel.pid_max = 655350
|