Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DDABF187DD for ; Wed, 17 Feb 2016 18:47:35 +0000 (UTC) Received: (qmail 38717 invoked by uid 500); 17 Feb 2016 18:47:14 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 38675 invoked by uid 500); 17 Feb 2016 18:47:14 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 38653 invoked by uid 99); 17 Feb 2016 18:47:13 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2016 18:47:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4B9751A089E for ; Wed, 17 Feb 2016 18:47:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id hZth6XDGYfRn for ; Wed, 17 Feb 2016 18:47:11 +0000 (UTC) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 653945F1EB for ; Wed, 17 Feb 2016 18:47:11 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id y9so19224398qgd.3 for ; Wed, 17 Feb 2016 10:47:11 -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=LMzKIBh6Qd9/0AW0Lo9tDkxDKOahyNOa+hFPt6YWp98=; b=yiKrk1GsLDU32axFok1e6VkpVidU6tZfd26kWSK3BLTbpREHNPCnnVKzSPTDN3KrfD Qwxwi3kOxpglBUAst1zBIRgF57uTTZroVWCK9xF6FeUV/Wru4A4u+HtaRiqwas+z2tHd pliROox89yYyJzsSAOGUb+KtjzlUqvRtBAZQH1GV2Rot6hW2FuYSx3cH9ebK+q3oawvn 9TUlOfIIS3yHo6CaI7bkdspzcYHCNS5yQsFmUkQcOOA6EDWXeg65CqKqMDd/JvIa/hU4 kzSgsmaKXrfoCQ9GpuHyHZv1rBrUD8mt6Cl5PbKniT8J3Y2n3qWzv2GHSim0wKSTYL4q 7qMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LMzKIBh6Qd9/0AW0Lo9tDkxDKOahyNOa+hFPt6YWp98=; b=N/GNA5zoOJbUlP+S5Awn/bBQhO3V2iwjQLIq/bz9lw/guJr4TSxOKeedGkLRPeO4d7 knmxtC0pZR8JNQD7/Lh2dC23j4KaiCCY+SZmFXVgZzCX41nAb4aSrZSP41pqIIaVyQ0c dY/zf5WPH71jz38BOgRTzeUEElisgE2j+AklYxLhpURGoTj+BL+LzQMmDllIfkrT3X4m ztZYehctVmvcdmUwFnkqC9nAUyOSyUiI+cMfeAQPvGxwE4zZk0nIQJsMk5UXhzopIfKC pIbFkUej0B6887NZVSOz3Q0Y8qoOACZEvcnXd3U38irLwLcYPcpXF82Az7g7NTptDdj6 F3jg== X-Gm-Message-State: AG10YORDsODuLvR2LWZHac7twzeBG8f0CPae6da1wbhDzrBh0v/y5lt/6gUFEzg1TUriytoe6uubCBuCmyjWDA== MIME-Version: 1.0 X-Received: by 10.140.32.100 with SMTP id g91mr3868033qgg.47.1455734830732; Wed, 17 Feb 2016 10:47:10 -0800 (PST) Received: by 10.55.116.65 with HTTP; Wed, 17 Feb 2016 10:47:10 -0800 (PST) In-Reply-To: References: <1400066881.11226.2.camel@ubuntu> <1400143180.23146.7.camel@ubuntu> <1450773397.31209.4.camel@apache.org> Date: Wed, 17 Feb 2016 19:47:10 +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=001a113b3870793612052bfbad24 --001a113b3870793612052bfbad24 Content-Type: text/plain; charset=UTF-8 Hello, I think I have fixed the issue in JMeter, I attached patch to: - https://bz.apache.org/bugzilla/show_bug.cgi?id=58099 Reviews and feedback very welcome. Regards On Tue, Jan 5, 2016 at 3:05 PM, sebb wrote: > On 22 December 2015 at 08:36, Oleg Kalnichevski wrote: > > On Sun, 2015-12-20 at 22:44 +0100, Philippe Mouawad wrote: > >> Hi Oleg, > >> Back to this old subject and knowing that we must stick to 1 HttpClient > per > >> thread (as per all the discussion that followed this). > >> Is there a plan to implement this lazy init of SSLContext in HttpClient > as > >> it used to be the case in HC3 ? > >> > >> For our project, it's a killer in terms of performance, and for other > use > >> cases, it appears kind of weird that an SSLContext is initialized even > for > >> a pure HTTP traffic. > >> > > > > Given that HttpClient instance should be initialized only once, eager > > initialization of the SSLContext looks reasonable to me. > > AFAICT there are lots of ways to configure the HttpClient instance by > using HttpClientBuilder or HttpClients. > So I don't understand why you say that the HttpClient instance should > only be initialised once. > > > One, of course, can make SSL initialization lazy by using a custom > > connection socket factory with SSLContext initialized on demand. > > > > Hope this helps > > > > 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. --001a113b3870793612052bfbad24--