2016-10-27 73 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的:背景處理器的延遲」 參數。