hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <philippe.moua...@gmail.com>
Subject Re: httpClient.getConnectionManager() performance with HTTP only
Date Fri, 23 Jan 2015 22:10:45 GMT
On Fri, Jan 23, 2015 at 10:00 PM, Oleg Kalnichevski <olegk@apache.org>
wrote:

> On Fri, 2015-01-23 at 20:42 +0100, Philippe Mouawad wrote:
> > On Fri, Jan 23, 2015 at 6:09 PM, Oleg Kalnichevski <olegk@apache.org>
> wrote:
>
> ...
>
> > > >
> > > > > Please note that if JMeter needs to simulate several physical users
> > > > > having a separate connection pool per distinct user may be the
> easiest
> > > > > and the most representative strategy.
> > > > >
> > > >
> > > > What is the object to use if it's not 1 HttpClient per user as we do
> > > today
> > > > ?
> > > >
> > > > PoolingHttpClientConnectionManager does not seem to be the one, as if
> > > > it's shared among threads, how could we reset it only for 1 user ?
> > > >
> > >
> > > You should continue using one HttpClient instance per distinct user
> > > either with a pooling or basic connection manager. The only thing you
> > > might want to customize is changing SSL context initialization from
> > > eager to lazy.
> > >
> > >
> > Does it means we are stuck with 1 HttpClient instance per distinct user ?
> >
>
> What do you mean by that? You do not have to use one HttpClient instance
> per distinct user, but it makes things easier if you really need to
> ensure that one user thread cannot re-use connections created by another
> user thread.
>
>
The requirement is related to Mutual SSL authentication feature (mainly
auth by certificate but also tests that want to put pressure on HTTPS by
replaying SSL Handshake).
To implement this we need to  Control reuse of cached SSL Context, see:
- https.use.cached.ssl.context property

Currently in JMeter, as we have 1 HttpClient per user, we are able to call
without impacting other user:

   - httpClient.getConnectionManager().closeIdleConnections(1,
   TimeUnit.MICROSECONDS);

My understanding of your answer was that if we switch to a shared
HttpClient instance doing this would have side effects on other users.

So I concluded we needed to stick to 1 HttpClient per Thread/User.

Did I misunderstand ?

If I did, then I still don't see how we can reset SSL Context for 1 user if
we have 1 HttpClient per thread/User.




> > Regarding eager to lazy, let me be a bit lazy :-), but as you seem to
> know
> > exactly what to do could you point me to the involved classes ?
> > I must reckon I have a lot of work on JMeter so if you can help me
> speedup
> > this It would be great.
> >
>
>
> http://hc.apache.org/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/socket/LayeredConnectionSocketFactory.html
>
> http://hc.apache.org/httpcomponents-client-4.3.x/httpclient/xref/org/apache/http/conn/ssl/SSLConnectionSocketFactory.html
>

Thanks a lot Oleg.

>
> Oleg
>
>
>


-- 
Cordialement.
Philippe Mouawad.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message