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 --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org