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 Aaron <at...@gmail.com> on 2005/11/16 21:24:47 UTC

rapid http connection use

Hi,

I am writing a performance testing tool that uses HttpClient; the tool
kicks off N threads, and each thread creates a PostMethod and executes
it via an HttpClient instance (configured with
MultiThreadedHttpConnectionManager). When each request thread
finishes, another thread takes its place immediately and
creates/executes another post method using the same HttpClient.  The
result is that I am rapidly creating PostMethods and executing them.
(I am ensuring that releaseConnection() is called in each thread.)

I am getting repeated java.net.BindExceptions, and I understand from
the research that I've done that this can happen if you are creating
socket connections so rapidly.  This has to do with TCP connections
sitting in a CLOSED state for some time after being closed.

My tool can be configured to have each request thread sleep some
number of milliseconds after releasing its connection.  When I
configure this sleep time to be high (~1 sec), the BindExceptions go
away.  I assume this is time needed for the released TCP connection to
leave its CLOSED state.  However, that this sleep time must be so high
is what concerns me.

HttpClient experts, can you help me around this issue?  How do I
dispatch these threads more quickly, without getting BindExceptions?

Thanks for any insights--

Aaron

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org