HttpClient超时在压力下缓慢

HttpClient超时在压力下缓慢

问题描述:

我正在使用HttpClient 3.1连接到不同的Web服务。我已将SO_TIMEOUT和ConnectionTimeout设置为3秒。我正在模拟一个响应时间超过3秒的服务。但是,实际超时时间要长得多,几分钟甚至更长。最后,服务器内存不足并停滞不前。

I am using HttpClient 3.1 to connect to a different web services. I have set SO_TIMEOUT and ConnectionTimeout to 3 seconds. I am simulating a service that takes more than 3 seconds to respond. However, actual timeout is much longer, up to few minutes and more. In the end, server is out of memory and stalls.

发生了什么事?为什么我的连接没有及时超时?

What is going on? Why my connections are not timing out in time?

好吧,这是基本的。我们没有使用 MultiThreadedHttpConnectionManager ,因此所有请求都被序列化了...... 。

Wel, this has been "elementary". We weren't using MultiThreadedHttpConnectionManager, so all requests were serialized....