HttpClient超时在压力下缓慢 [英] HttpClient time-out slow under stress

查看:135
本文介绍了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....

这篇关于HttpClient超时在压力下缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆