1 打开文件句柄数:

在 /etc/security/limits.conf 文件 尾添加

* soft nofile 65535

* hard nofile 65535

* soft nproc 65535

* hard nproc 65535

. /etc/security/limits.conf

2 关闭selinux

/etc/selinux/config  

SELINUX=disabled

3 优化内核:

/etc/sysctl.conf 

net.ipv4.ip_local_port_range = 1024 65000

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_tw_reuse = 1

#net.ipv4.tcp_syncookies = 0

net.core.somaxconn = 262144

sysctl -p