You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Algirdas Veitas <av...@allesta.com> on 2008/07/17 00:59:11 UTC

Long Execution Times for MultiThreadedHttpConnectionManager.doGetConnection

Hi,

Our application is using HttpClient 3.0.1 and is experiencing "long wait
times" (started happening recently it seems) in the method
MultiThreadedHttpConnectionManager.doGetConnection(...).  To give a summary
of the application, we have a bunch of threads (message driven beans, JBoss
4.0.2, JDK 1.4)  that are processing a message, creating xml out of it and
then sending the xml over an HTTP Post.  The HTTP Post is always to one
static URL and the target web server is IIS.  Threads are running
concurrently and have a cap of 30 in the pool, all threads are pretty much
constantly processing a request.    We release the connection in our finally
block (if (postMethod != null) { postMethod.releaseConnection(); } )

As an example of the long wait times, we profiled one of our worker threads
and it took 3781 ms to process a message and do the HTTP Post. Out of the
3781 ms, 3628 ms are within
MultiThreadedHttpConnectionManager.doGetConnection(...) versus 67 ms to
perform the actual HTTP Post (via PostMethod.execute()).

Our profiler shows that methods called within
MultiThreadedHttpConnectionManager.doGetConnectiont(...) take no more than 1
ms.

Not sure what to make of this at this point, but it seems strange that there
is such a long wait time. We wire up the HttpClient configuration via
Spring, but essentially it looks like this:

httpConnectionManagerParams.setMaxConnections(40);
httpConnectionManagerParams.setSoTimeOut(1500);
multiThreadedHttpConnectionManager.setParams(httpConnectionManagerParams);

httpClient.setHttpConnectionManager(multiThreadedHttpConnectionManager);

Has anyone experienced such behavior before?  Perhaps need to fine tune the
configuration?

Please let me know if more information is needed, will certainly provide it.

Thanks,
Al