jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: httpClient.getConnectionManager() performance with HTTP only
Date Wed, 14 May 2014 11:28:01 GMT
On Tue, 2014-05-13 at 23:59 +0200, Philippe Mouawad wrote:
> Hello,
> We have a report of Performance issue when using HttpClient4 with HTTP.
> 
> User noticed cacert was read very frequently.
> 
> I traced the calls and it is due to :
> HttpClient#getConnectionManager()
> =>
> 
>     public synchronized final ClientConnectionManager
> getConnectionManager() {
>         if (connManager == null) {
>             connManager = createClientConnectionManager();
>         }
>         return connManager;
>     }
> 
> ==>        final SchemeRegistry registry =
> SchemeRegistryFactory.createDefault();
> 
> ====>         registry.register(
>                 new Scheme("https", 443,
> SSLSocketFactory.getSocketFactory()));
> 
> 
> =======>
>     public static SSLSocketFactory getSocketFactory() throws
> SSLInitializationException {
>         SSLContext sslcontext;
>         try {
>             sslcontext = SSLContext.getInstance("TLS");
>             sslcontext.init(null, null, null); <======== Reads CACERTS
>             return new SSLSocketFactory(
>                 sslcontext,
>                 BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
>         } catch (NoSuchAlgorithmException ex) {
>             throw new SSLInitializationException(ex.getMessage(), ex);
>         } catch (KeyManagementException ex) {
>             throw new SSLInitializationException(ex.getMessage(), ex);
>         }
>     }
> This reads the cacerts.
> In this case user is not using HTTPS at all but gets this performance issue
> 
> Issue is not present in HTTPCLient 3.1

Philippe

If HttpClient is used correctly, this code should only be executed only
once. Why does JMeter create more than one instance of HttpClient?

Oleg


Mime
View raw message