最基础的使用:
jmeter500个线程
服务端的连接情况:
zefenglin@192 bin % netstat |grep 38080|grep '^tcp' |awk '{print $6}' |sort |uniq -c
9708 CLOSE_WAIT
292 ESTABLISHED
tomcat设置最大连接数为10000,性能明显有提升,基本稳定,很少报错服务端连接数为500,大量的time_wait,原因未明?
zefenglin@192 bin % netstat |grep 38080|grep '^tcp' |awk '{print $6}' |sort |uniq -c
488 ESTABLISHED
12 SYN_RCVD
6860 TIME_WAIT
zefenglin@192 bin % netstat |grep 38080|grep '^tcp' |awk '{print $6}' |sort |uniq -c
458 ESTABLISHED
42 FIN_WAIT_1
7663 TIME_WAIT
<Connector port="38080" protocol="HTTP/1.1"
connectionTimeout="20000" maxThreads="10000"
redirectPort="8443" />
jmeter,1000线程;报错明显增加:
大量的connetction reset,connection timeout
zefenglin@192 bin % netstat |grep 38080|grep '^tcp' |awk '{print $6}' |sort |uniq -c
747 ESTABLISHED
17 FIN_WAIT_1
25 SYN_RCVD
12746 TIME_WAIT
zefenglin@192 bin % netstat |grep 38080|grep '^tcp' |awk '{print $6}' |sort |uniq -c
366 ESTABLISHED
59 FIN_WAIT_1
7129 TIME_WAIT
查看端口所占用的进程号
lsof -i:38080
#查看端口所占用的进程号
zefenglin@192 ~ % lsof -i:38080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 682 zefenglin 54u IPv6 0x6ff4ecc6dcf5bb1b 0t0 TCP *:38080 (LISTEN)
阻塞总数
Blocked count is the total number of times that the thread blocked to enter or reenter a monitor. I.e. the number of times a thread has been in the java.lang.Thread.State.BLOCKED state.
等待总数
Waited count is the total number of times that the thread waited for notification. i.e. the number of times that a thread has been in the ava.lang.Thread.State.WAITING or java.lang.Thread.State.TIMED_WAITING state.
<Executor name="tomcatThreadPool" namePrefix ="lzf-exec-" maxThreads="2000" minSpareThreads="2000" />
<Connector port="38080" protocol="HTTP/1.1" acceptCount="1000" maxConnections="15000"
connectionTimeout="20000" executor="tomcatThreadPool"
maxKeepAliveRequests="2"
redirectPort="8443" />
<Context path="" docBase="/Users/zefenglin/opensource/apache-tomcat-8.5.70/webapps/high-concurrent"/>
JSSE_OPTS="-Djdk.tls.ephemeralDHKeySize=2048 -DlogPath=/Users/zefenglin/workspace/gitee2/highconcurrent/logs"
connetction reset
read timeout
connection time out
疑问:
wait和sleep的区别:
线程状态:wait和blocked的区别
connetction reset
read timeout
connection time out
socket ,TCP连接, 和http请求,线程之间的关系是怎样的?