hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpClient 3.1 / JavaHttp TIME_WAIT differences
Date Thu, 06 Dec 2007 11:54:08 GMT

On Thu, 2007-12-06 at 11:29 +0000, sebb wrote:
> On 06/12/2007, Oleg Kalnichevski <olegk@apache.org> wrote:
> >
> > On Wed, 2007-12-05 at 18:34 +0000, sebb wrote:
> > > I'm trying to pin down why JMeter sometimes leaves connections in
> > > TIME_WAIT state and sometimes does not.
> > >
> > > So I've written an simple app to compare Java and HttpClient.
> > > The app expects URL, autoredirect=true/false, keep-alive=true/false
> > > It connect using either httpclient or java, and then disconnects and exits.
> > >
> > > The results seem to be a bit odd:
> > >
> > > Example 1: http://www.google.co.uk/ auto-redirect=false, no keep-alive
> > >
> > > Neither HttpClient nor Java leave behind a connection in TIME_WAIT state
> > >
> > > Example 2: http://www.google.co.uk/ auto-redirect=false, keep-alive=true
> > >
> > > Java leaves a socket in TIME_WAIT state, HttpClient does not.
> > >
> > > Example 3: http://www.google.com/ auto-redirect=true, keep-alive=false
> > > [Redirects to www.google.co.uk]
> > >
> > > Neither HttpClient nor Java leave behind a connection in TIME_WAIT state
> > >
> > > Example 4: http://www.google.com/ auto-redirect=true, keep-alive=true
> > > [Redirects to www.google.co.uk]
> > >
> > > HttpClient leaves a connection to www.google.com in TIME_WAIT
> > > Java leaves connections to both www.google.com and www.google.co.uk in TIME_WAIT
> > >
> > > ====
> > >
> > > It's a bit odd that HttpClient does not leave a connection in
> > > TIME_WAIT to www.google.co.uk when keep-alive is true, yet it does
> > > leave one to www.google.com.
> >
> >
> > Sebastian,
> >
> > What is the state of the connection www.google.co.uk? Can you post the
> > wire logs of both sessions?
> 
> .co.uk is not shown as an open connection.
> 

Weird. What's your OS? 

> I've set up logging for wire headers only - is that enough, or do you
> want the full wire logs?
> 

Could you please do headers + context for both sessions? 

Oleg


> > Oleg
> >
> > >
> > > As far as I can tell, it is the auto-redirect that causes HttpClient
> > > to leave the connection in TIME_WAIT state.
> > >
> > > It looks like Java always leaves the connection in TIME_WAIT state if
> > > keep-alive was selected.
> > >
> > > Any idea why there is this difference?
> > >
> > > Sebb
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


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


Mime
View raw message