压测过程中,发现Agent上TIME_WAIT 的连接数过多;通过如下命令查看
netstat -an | awk '/^tcp/ {++s[$NF]} END {for(a in s) print a,s[a]}'
[root@sc-lyg-fls ~]# netstat -an | awk '/^tcp/ {++s[$NF]} END {for(a in s) print a,s[a]}'
LISTEN 7
ESTABLISHED 42
FIN_WAIT1 1
SYN_SENT 1
TIME_WAIT 1916
jmeter端出现连接被拒绝的错误
/etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65536
net.ipv4.ip_conntrack_max = 10240
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.core.somaxconn = 262144
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_fin_timeout = 20
/sbin/sysctl -p /etc/sysctl.conf
/sbin/sysctl -w net.ipv4.route.flush=1
echo ulimit -HSn 65536 >> /etc/rc.local
echo ulimit -HSn 65536 >>/root/.bash_profile
ulimit -HSn 65536
转载请注明:梦绘设计 » 测试服务 » Linux压测 参数调整
版权声明
本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。