diegopatr wrote:
Hi all,
I'm using HTTPClient together with Axis 2. My threads executes thousands of
calls to webservices per day. Sometimes those threads blocks forever, none
of the timeouts are executed and I need to restart the application. I have
researched everything in the net but I can't found a solution.
I put the logs in TRACE mode. The last log message when a thread became
blocked is always the same:
DEBUG org.apache.commons.httpclient.HttpConnection - Open connection to
xxx.xxx.xxx.xxx:443
The next message should be:
TRACE org.apache.commons.httpclient.HttpMethodBase - enter
HttpMethodBase.execute(HttpState, HttpConnection)
Which blocking operations are doing between this two points?
Socket connect and SSL handshaking, which A LOT
I have one MultiThreadedHttpConnectionManager and one HTTPClient shared
between all the threads.
I setup it using this code:
HttpConnectionManagerParams cmparams = new
HttpConnectionManagerParams();
cmparams.setSoTimeout(timeout);
cmparams.setDefaultMaxConnectionsPerHost(100);
cmparams.setMaxTotalConnections(500);
cmparams.setConnectionTimeout(timeout);
cmparams.setTcpNoDelay(true);
HttpClientParams params = new HttpClientParams();
params.setSoTimeout(timeout);
params.setConnectionManagerTimeout(timeout);
conmgr = new MultiThreadedHttpConnectionManager();
conmgr.setParams(cmparams);
httpClient = new HttpClient(params, conmgr);
What you suggested to resolve this problem?
Implement a custom socket factory which would give you a complete
control over the process of connection setup.
Also consider upgrading to HttpClient 4.0
Oleg
Thanks,
Diego Patricio
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]