我有一个带有camel-jetty消费者的akka(Java)应用程序。在一些最小负载(大约10 TPS)下,我们的客户端开始看到HTTP 503错误。我试图在我们的实验室中重现这个问题,看起来jetty无法处理重叠的HTTP请求。以下是apache bench(ab)的输出:
ab使用一个线程发送10个请求(即一次一个请求)
ab -n 10 -c 1 -p bad.txt http://192.168.20.103:8899/pim
Benchmarking 192.168.20.103 (be patient).....done
Server Software: Jetty(8.1.16.v20140903)
Server Hostname: 192.168.20.103
Server Port: 8899
Document Path: /pim
Document Length: 33 bytes
Concurrency Level: 1
Time taken for tests: 0.61265 seconds
Complete requests: 10
Failed requests: 0
Requests per second: 163.23 [#/sec] (mean)
Time per request: 6.126 [ms] (mean)
Time per request: 6.126 [ms] (mean, across all concurrent requests)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.0 1 2
Processing: 3 4 1.8 5 7
Waiting: 2 4 1.8 5 7
Total: 3 5 1.9 6 8
Percentage of the requests served within a certain time (ms)
50% 6
66% 6
75% 6
80% 8
90% 8
95% 8
98% 8
99% 8
100% 8 (longest request)
ab使用两个线程发送10个请求(同时最多2个请求):
ab -n 10 -c 2 -p bad.txt http://192.168.20.103:8899/pim
Benchmarking 192.168.20.103 (be patient).....done
Server Software: Jetty(8.1.16.v20140903)
Server Hostname: 192.168.20.103
Server Port: 8899
Document Path: /pim
Document Length: 33 bytes
Concurrency Level: 2
Time taken for tests: 30.24549 seconds
Complete requests: 10
Failed requests: 1
(Connect: 0, Length: 1, Exceptions: 0)
// obmited for clarity
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.9 1 2
Processing: 3 3005 9492.9 4 30023
Waiting: 2 3005 9492.7 3 30022
Total: 3 3006 9493.0 5 30024
Percentage of the requests served within a certain time (ms)
50% 5
66% 5
75% 7
80% 7
90% 30024
95% 30024
98% 30024
99% 30024
100% 30024 (longest request)
我不相信码头这么糟糕。希望这只是一个配置问题。这是我的驼色消费者URI的设置:
"jetty:http://0.0.0.0:8899/pim?replyTimeout=70000&autoAck=false"
我正在使用akka 2.3.12和camel-jetty 2.15.2
答案 0 :(得分:0)
Jetty肯定不是那么糟糕,应该能够处理成千上万的TPS连接成千上万的连接。
很难诊断你所说的,除了Jetty在加载时不发送503的内容......除非可能部署了拒绝服务保护过滤器? (并且ab看起来像是DOS攻击......它基本上是并且不是用于基准测试的强大负载生成器。)
所以你需要追踪发送503的原因和原因。
答案 1 :(得分:0)
这是我的错误代码:发件人(客户端)信息被重叠请求覆盖。由于Jetty持续超时,发送了503错误消息。