集群Master节点巡检
1、小天才 手表业务 UK8S集群Master巡检:
一、Master配置
1、 当前三台Master配置均为4C8G,集群worker节点总数量已达71台,但观察虚拟机CPU使用率较低,因此短期内Master并无配置升级的必要,后续如果worker节点扩容到100台以上,建议升级到8C16G。 另Master所在宿主的CPU、内存、磁盘及网络IO均处于可接受水平。
2、三台Master分布在不同的宿主节点上。
二、集群及插件版本
1、K8S版本: V1.17.4,较新
2、CSI版本:csi-uk8s-20.03.1
3、CNI版本:cnivpc-20.05.1 cnivpc-20.09.1 cnivpc-20.10.1
4、CloudProvider版本: cloudprovider-20.10.2
备注:1) CNI最新版本为20.11.1,支持hostport; 2)CSI最新版本为20.10.1,相对当前版本支持盘扩容等特性; 3)CloudProvider最新版本为20.10.2
建议: cni版本升级到最新版本,或者20.10.1均可。
三、系统参数
当前Master及Node的镜像内核参数如下:
net.ipv4.ip_local_port_range = 12000 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.conf.eth0.proxy_arp = 1
net.ipv4.ip_forward = 1
vm.max_map_count = 262144
net.netfilter.nf_conntrack_max = 1048576
kernel.unknown_nmi_panic = 0
kernel.sysrq = 1
fs.file-max = 1000000
vm.swappiness = 10
fs.inotify.max_user_watches = 10000000
net.core.wmem_max = 327679
net.core.rmem_max = 327679
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
fs.inotify.max_queued_events = 327679
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.neigh.default.gc_thresh1 = 2048
net.ipv4.neigh.default.gc_thresh2 = 4096
net.ipv4.neigh.default.gc_thresh3 = 8192
net.ipv6.conf.all.disable_ipv6 = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.conf.all.arp_ignore = 0
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 6
kernel.pid_max = 1024000
2、小天才 广州 UK8S集群Master巡检:
一、Master配置
1、 当前三台Master配置均为4C8G,集群worker节点总数量已达13台,虚拟机CPU使用率更低,无需升级。 另Master所在宿主的CPU、内存、磁盘及网络IO均处于可接受水平。
2、三台Master分布在不同的宿主节点上,物理机级别容灾。
二、集群及插件版本
1、K8S版本: V1.15.5
2、CSI版本:无信息,建议检查是否为flexvolume
3、CNI版本:cnivpc-19.12.1
4、CloudProvider版本: cloudprovider-19.10.2
备注:1) CNI最新版本为20.11.1,支持hostport; 2)CSI最新版本为20.10.1,相对当前版本支持盘扩容等特性; 3)CloudProvider最新版本为20.10.2
建议:建议CSI、CNI、Cloudprovider均升级到最新版本;
三、系统参数
当前Master及Node的镜像内核参数如下:
net.ipv4.ip_local_port_range = 12000 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.conf.eth0.proxy_arp = 1
net.ipv4.ip_forward = 1
vm.max_map_count = 262144
net.netfilter.nf_conntrack_max = 1048576
kernel.unknown_nmi_panic = 0
kernel.sysrq = 1
fs.file-max = 1000000
vm.swappiness = 10
fs.inotify.max_user_watches = 10000000
net.core.wmem_max = 327679
net.core.rmem_max = 327679
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
fs.inotify.max_queued_events = 327679
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.neigh.default.gc_thresh1 = 2048
net.ipv4.neigh.default.gc_thresh2 = 4096
net.ipv4.neigh.default.gc_thresh3 = 8192
net.ipv6.conf.all.disable_ipv6 = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.conf.all.arp_ignore = 0
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 6
kernel.pid_max = 1024000
建议:uk8s-grlyc3qw-n-zfn2x uk8s-grlyc3qw-n-opuyk uk8s-grlyc3qw-n-dklan uk8s-grlyc3qw-n-e0tw0 uk8s-grlyc3qw-n-53vm3 uk8s-grlyc3qw-n-n0kzw uk8s-grlyc3qw-n-nv4kg uk8s-grlyc3qw-n-jzf0u uk8s-grlyc3qw-n-3vjv4 uk8s-grlyc3qw-n-wob36 均为低内核版本节点,建议通过滚动升级的方式更新到最新版本。
长连接问题
单机最大长连接数的限制主要受限于以下几个因素:
1、文件描述符的限制;
一个进程可以打开的最大文件数受限于file-max,nr_open参数,这几个参数虚拟机一般开的比较大,理论上可以到几十亿级别,因此一般文件描述符不会成为长连接上线的瓶颈。
2、系统内存的限制;
网络报文的元数据大小等都会占用系统内存,但这里没有一个标准的公式,每个应用都不太一样,特别是很多长连接可能非活跃链接,开销占用极小。 因此内存设置更多是基于应用来设置。
一般压测应用的话,如果数据量较小,4G内存就可以应对50w左右的长连接了。
但由于运行在Node节点上的容器共用虚拟机内核,因此需要考虑容器打散的问题,同类型业务尽量通过反亲和性调度到不同的Node节点。
结论:
1、如果虚拟机可以承载60w的长链接业务,那容器同等配置下,也可以同样承载。
2、但要避免在部署该容器的虚拟机上部署同类型的其他业务,避免资源争抢。