我正在对我的应用程序进行AB测试,我在其中发送3000个并发请求和总共10000个请求。我的应用程序是带有执行器的spring boot应用程序,我使用kubernetes和docker进行容器化。在测试过程中,我的执行器终点花费的时间比预期的要长,因为这会导致我的吊舱重启并且请求开始失败。
现在我已经停止了活动性探针,并且在测试期间,如果我手动击中执行器端点,我可以看到它花了很多时间来回复,有时甚至不返回结果而只是卡住了。
根据日志,我可以看到我的应用程序在10毫秒内满足了每个请求。但是AB测试结果完全不同。以下是AB测试的结果:
Concurrency Level: 3000
Time taken for tests: 874.973 seconds
Complete requests: 10000
Failed requests: 6
(Connect: 0, Receive: 0, Length: 6, Exceptions: 0)
Non-2xx responses: 4
Total transferred: 1210342 bytes
Total body sent: 4950000
HTML transferred: 20580 bytes
Requests per second: 11.43 [#/sec] (mean)
Time per request: 262491.958 [ms] (mean)
Time per request: 87.497 [ms] (mean, across all concurrent requests)
Transfer rate: 1.35 [Kbytes/sec] received
5.52 kb/s sent
6.88 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 372 772.5 0 3051
Processing: 1152 226664 145414.1 188502 867403
Waiting: 1150 226682 145404.6 188523 867402
Total: 2171 227036 145372.2 188792 868447
Percentage of the requests served within a certain time (ms)
50% 188792
66% 249585
75% 295993
80% 330934
90% 427890
95% 516809
98% 635143
99% 716399
100% 868447 (longest request)
无法理解此行为,因为它显示在一秒钟内仅响应了11.43个请求,这是非常低的。可能是什么原因 ?另外,保持活力探针的方法应该是什么?
我在application.properties中设置了以下属性:
server.tomcat.max-connections=10000
server.tomcat.max-threads=2000