linux服务器高并发修改
1.新增Linux句柄上限
a)将ulimit值添加到/etc/profile文件中:
在文件profle中添加:
ulimit -n 65535
设置生效:
$: source /etc/profle $:ulimit -n #显示65535,修改完毕!
b)修改linux的软硬件限制文件/etc/security/limits.conf
在文件尾部添加如下代码:
$: soft nofile 65535 $: hard nofile 65535
2.Tcp内核参数优化
在文件profile中添加如下配置:
$:net.ipv4.tcp_tw_reuse = 1 #表示开启重用。允许将TIME-WAIT sockets重新用于新的TCP连接,默认为0,表示关闭; $:net.ipv4.tcp_tw_recycle = 1 #recyse是加速TIME-WAIT sockets回收 $:net.ipv4.tcp_fin_timeout = 30 #fin_wait1状态是在发起端主动要求关闭tcp连接,并且主动发送fin以后,等待接收端回复ack时候的状态 $:net.ipv4.tcp_keepalive_time = 1200 $:net.ipv4.tcp_keepalive_probes = 3 $:net.ipv4.tcp_keepalive_intvl = 15
设置生效:source/etc/profle
相关推荐
bluecarrot 2020-11-23
Attend 2020-11-17
ZHAICAN 2020-11-16
codedecode 2020-11-14
zhangbingb 2020-11-12
ykmail 2020-11-11
futurezone 2020-11-06
rikeyone 2020-11-04
橄榄 2020-11-04
WenCoo 2020-10-31
liuyuchen 2020-10-27
ROES 2020-10-24
Gexrior 2020-10-22
ZHAICAN 2020-10-20
风语者 2020-10-16
zhongguomin 2020-10-16
净无邪 2020-10-15