Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B58241032D for ; Mon, 29 Dec 2014 14:15:30 +0000 (UTC) Received: (qmail 14049 invoked by uid 500); 29 Dec 2014 14:15:31 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 14020 invoked by uid 500); 29 Dec 2014 14:15:31 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 13931 invoked by uid 99); 29 Dec 2014 14:15:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 14:15:25 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of philippe.mouawad@gmail.com designates 209.85.213.169 as permitted sender) Received: from [209.85.213.169] (HELO mail-ig0-f169.google.com) (209.85.213.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 14:15:21 +0000 Received: by mail-ig0-f169.google.com with SMTP id z20so527501igj.4 for ; Mon, 29 Dec 2014 06:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qGQhk813jgKs8ixgjDqs4hJgtS5smMeiAualDWZlA5E=; b=UEwe0a/5dKWeJm62AVhU2l2ukaxznPpFYsOSzuUt+K+FG7sVK/XI4qvEAsQTtGHjUj zpZTM4532QNYawinNHwTWxJ90Zce7rJCXEkm0ZlhrVPr/81Ef+xJbOb81nno5hPzzU2B 88vHwTU4CpAxSVS7W9R9XHQcMjY2vOe6PCMf5zNssMSrsCsb6u2RT2XAWSM48kum2yGk b+qgTL0ChL5nMv290dg+ETdsDFidT+xbDiUKTBw3PORqgOQHiAf+WQsJQD1KQ7tcQ2M1 OztZGmb55eB/HvjoUojOx4ZBbq0AzZiGwjvYvC1iRqy/sAKo0UaT3UQjyoxpdGxzFF6H 7cfA== MIME-Version: 1.0 X-Received: by 10.50.138.107 with SMTP id qp11mr36303144igb.46.1419862500562; Mon, 29 Dec 2014 06:15:00 -0800 (PST) Received: by 10.42.62.202 with HTTP; Mon, 29 Dec 2014 06:15:00 -0800 (PST) In-Reply-To: <1419843885.1731.2.camel@apache.org> References: <1400066881.11226.2.camel@ubuntu> <1400143180.23146.7.camel@ubuntu> <1419843885.1731.2.camel@apache.org> Date: Mon, 29 Dec 2014 15:15:00 +0100 Message-ID: Subject: Re: httpClient.getConnectionManager() performance with HTTP only From: Philippe Mouawad To: "dev@jmeter.apache.org" Cc: HttpClient User Discussion Content-Type: multipart/alternative; boundary=001a1135edcef9e46c050b5b7fe1 X-Virus-Checked: Checked by ClamAV on apache.org --001a1135edcef9e46c050b5b7fe1 Content-Type: text/plain; charset=ISO-8859-1 Hi Oleg, Thanks for answers. Clarifications below inline. Regards On Mon, Dec 29, 2014 at 10:04 AM, Oleg Kalnichevski wrote: > On Sun, 2014-12-28 at 22:09 +0100, Philippe Mouawad wrote: > > Hi, > > Related to this topic, once we switch to 1 instance of HttpClient shared > by > > all threads, how can we reset SSLContext ? > > We need this feature within jmeter to simulate SSL handshake per client , > > we currently do : > > httpClient.getConnectionManager().shutdown(); > > Which by the way is rather very inefficient way to do this. > > > > What do you mean by resetting SSLContext, changing some SSL handshake > parameters? > In JMeter, when we want to simulate Client certicate authentication, we currently "reset" SSL Context by calling httpClient.getConnectionManager().shutdown(); in order to reproduce the SSL renegociation: https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java See lines 630 to 638. > One can force SSL renegotiation by evicting all idle connections from > the connection pool. > Ok, that's good to know, so it means even today it would be better to call this instead: httpClient.getConnectionManager().closeIdleConnections(1, TimeUnit.MICROSECONDS); > 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 ? > Cheers > > Oleg > > > Thanks > > Regards > > > > On Thu, May 15, 2014 at 10:39 AM, Oleg Kalnichevski > > wrote: > > > > > On Wed, 2014-05-14 at 19:46 +0100, sebb wrote: > > > > On 14 May 2014 12:28, Oleg Kalnichevski wrote: > > > > > > ... > > > > > > > >> 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? > > > > > > > > We currently create an instance for each instance of different proxy > > > > settings and each protocol and each authority, because the client is > > > > created with these settings. > > > > > > > > This is also done for each thread. > > > > > > > > IIRC, this was necessary originally. We have not rewritten the code > > > > yet to use all the latest features. > > > > > > > > > > I see. For the time what you can do is to use a custom SSL socket > > > factory that lazily initializes SSL context when requested for the > first > > > time. This is exactly what HC 3.1 does. It will be somewhat slower > given > > > that one would need to mutex to synchronize access to the > initialization > > > code. > > > > > > Oleg > > > > > > > > Oleg > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org > > > > For additional commands, e-mail: httpclient-users-help@hc.apache.org > > > > > > > > > > > > > > > > -- Cordialement. Philippe Mouawad. --001a1135edcef9e46c050b5b7fe1--