2016-10-27 41 views
0

我负载测试与嵌入式码头/ tomcat春季启动应用程序,我得到了奇怪的行为。我使用apache ab进行测试春季启动负载测试:一些请求卡住

ab -n 100000 -c 1000 http://127.0.0.1:8080/ping 

Server Software:   
Server Hostname:  127.0.0.1 
Server Port:   8080 

Document Path:   /ping 
Document Length:  2 bytes 

Concurrency Level:  1000 
Time taken for tests: 5.253 seconds 
Complete requests:  100000 
Failed requests:  0 
Total transferred:  17000000 bytes 
HTML transferred:  200000 bytes 
Requests per second: 19038.05 [#/sec] (mean) 
Time per request:  52.526 [ms] (mean) 
Time per request:  0.053 [ms] (mean, across all concurrent requests) 
Transfer rate:   3160.61 [Kbytes/sec] received 

Connection Times (ms) 
       min mean[+/-sd] median max 
Connect:  0 37 222.1  0 3006 
Processing:  0 7 21.9  3  855 
Waiting:  0 7 21.7  3  853 
Total:   0 44 228.0  4 3052 

Percentage of the requests served within a certain time (ms) 
    50%  4 
    66%  7 
    75%  9 
    80%  11 
    90%  22 
    95%  39 
    98% 1004 
    99% 1017 
100% 3052 (longest request) 

所以有些请求卡在某处。
随着码头我尝试不同的值:

_maxThreads, _minThread 

和Tomcat:

max-connections, max-threads, min-spare-threads 

在探查我找到了下:

org.eclipse.jetty.util.thread.QueuedThreadPool$2.run()    16,215ms 
    org.eclipse.jetty.util.thread.QueuedThreadPool.access$800 
     org.eclipse.jetty.util.thread.QueuedThreadPool.iddleJobPoll 
      org.eclipse.jetty.util.BlockingArrayQueue.poll   13,915ms 

谢谢!

+0

我不确定我真的明白是什么让你觉得某些请求被卡住了? – jchampemont

+0

嗨。为什么98%是1秒? 98%的requeseets是好的。但2%的时间很长。奇怪的东西。与-k(keepAlive)选项结果是更好的 –

回答

0

最后,我找到了答案。每30秒出现一些问题。

load test

这发生由于 “服务器:Tomcat的:背景处理器的延迟” 参数。