一、修改tcp连接限制
1、编辑
vi /etc/sysctl.conf
2、内容
net.ipv4.tcp_keepalive_intvl = 75 net.ipv4.tcp_keepalive_probes = 9 net.ipv4.tcp_keepalive_time = 7200 net.ipv4.ip_local_port_range = 1024 65535 net.ipv4.ip_conntrack_max = 20000 net.ipv4.tcp_max_tw_buckets = 20000 net.core.somaxconn = 65535 net.ipv4.tcp_max_syn_backlog = 262144 net.core.netdev_max_backlog = 30000 net.ipv4.tcp_tw_recycle = 0 fs.file-max = 6815744 net.netfilter.nf_conntrack_max = 2621440
注: 存在则修改数值;不存在,则添加
3、保存后执行
modprobe br_netfilter ls /proc/sys/net/bridge sysctl --p service network restart
~
二、修改最大可修改文件数
1、编辑
vi /etc/security/limits.conf
2、末尾添加
* soft nofile 1024000 * hard nofile 1024000 * soft nproc 1024000 * hard nproc 1024000
3、保存后,重新登录或重启服务器;否则不生效
~~