大量长连接服务器配置
以centos6.5为例
1.修改/etc/sysctl.conf,sysctl-p执行
net.netfilter.nf_conntrack_max = 655350 net.core.somaxconn = 2048 net.core.rmem_default = 262144 net.core.wmem_default = 262144 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 4096 16777216 net.ipv4.tcp_wmem = 4096 4096 16777216 net.ipv4.tcp_mem = 786432 2097152 3145728 net.ipv4.tcp_max_syn_backlog = 16384 net.core.netdev_max_backlog = 20000 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_max_orphans = 131072 net.ipv4.tcp_timestamps=0 net.ipv4.tcp_max_tw_buckets=100000
2.修改打开文件句柄数上限:
echo -n 2000000 > /proc/sys/fs/nr_open
3.修改/etc/security/limits.conf,以root用户为例
root soft nproc 100000 root hard nproc 100000 root soft nofile 2000000 root hard nofile 2000000
相关推荐
airfish000 2020-09-11
huangzonggui 2020-06-05
zhangwentaohh 2020-05-29
roddex00 2020-04-20
sanshamo 2020-03-27
furongwei 2020-03-26
zlsh00 2020-03-23
oLeiShen 2020-03-07
sapliang 2020-02-22
leodengzx 2020-01-31
meylovezn 2020-01-08
vanturman 2019-12-27
leodengzx 2019-12-27
leodengzx 2019-12-18
sapliang 2019-12-16
furongwei 2019-12-15
wq0 2019-12-14