1. 禁用NUMA,更改IO调度为deadline (ssd盘:elevator=noop)
1、修改:
[root@clone2 ~]# vim /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off elevator=deadline"
2、生成配置:
[root@clone2 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
3、检查是否生效:
[root@clone2 ~]# numactl --hardware
node 0 cpus: 0 1
node 0 size: 2043 MB
node 0 free: 128 MB
node distances:
node 0
0: 10
[root@clone2 ~]# cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
2. 单用户进程 & 文件句柄限制 (centos 7之前的版本)
[root@cl01 ~]# echo "fs.file-max=100000">>/etc/sysctl.conf
[root@cl01 ~]# vim /etc/security/limits.conf
- soft nproc 65535
- hard nproc 65535
- soft nofile 65535
- hard nofile 65535
重启生效
3. 网络 & swap参数调优
[root@cl01 ~]# vim /etc/sysctl.conf
net.ipv4.tcp_max_syn_backlog=819200
net.core.netdev_max_backlog=400000
net.core.somaxconn=4096
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=0
vm.swapiness=5
[root@cl01 ~]# sysctl -p
网友评论