Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC0F16CAD for ; Fri, 15 Jul 2011 15:28:20 +0000 (UTC) Received: (qmail 46288 invoked by uid 500); 15 Jul 2011 15:28:20 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 46233 invoked by uid 500); 15 Jul 2011 15:28:19 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 46225 invoked by uid 99); 15 Jul 2011 15:28:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 15:28:19 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bill.speirs@gmail.com designates 209.85.210.179 as permitted sender) Received: from [209.85.210.179] (HELO mail-iy0-f179.google.com) (209.85.210.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 15:28:11 +0000 Received: by iyn35 with SMTP id 35so1312755iyn.10 for ; Fri, 15 Jul 2011 08:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=rodEEOdWCQblqs2JEpoIh/KeDfQz/mjzq4GNd8XnEkU=; b=p6atctWeRtQrul0/rv9qeQHbyTwnN20/hroW4ckZD4RfZXHgBcVz3MczD/g42Bu4Qw HF0HKjXiutkZ1gGvJVqaahcoRfSSIetCJUuruVEILZflDmLmu1mnI7nVFejOpzgfDdFB VDboHHNo8CCOFkoQ3x7fuoa96TO5tQZnOhAVY= MIME-Version: 1.0 Received: by 10.231.116.215 with SMTP id n23mr3127603ibq.143.1310743669984; Fri, 15 Jul 2011 08:27:49 -0700 (PDT) Received: by 10.231.14.134 with HTTP; Fri, 15 Jul 2011 08:27:49 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jul 2011 11:27:49 -0400 Message-ID: Subject: Re: HttpClient Performance Issues From: Bill Speirs To: HttpComponents Project Content-Type: multipart/mixed; boundary=001636eef97fd74bee04a81d4a3a X-Virus-Checked: Checked by ClamAV on apache.org --001636eef97fd74bee04a81d4a3a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Digging a bit deeper. I captured the execute time for JRE, Client4, and Netty and made the following graph. As can be clearly seen, both JRE and Client4 spend all of their time (sometimes as long as 6 seconds) on the initial 100 requests (or one per thread). Whereas Netty is flat across all requests. (Also, it doesn't look like Netty runs concurrently.) What is the up-front costs for Client4? How can I off-load that time? Thanks... Bill- On Fri, Jul 15, 2011 at 10:03 AM, Bill Speirs wrote= : > I am having performance issues with the HttpClient. I first noticed > these issues in my own code, but they are repeatable in the > httpclient-benchmark code as well. > > I have an httpd server setup with a 45 byte static page on a machine > on the same network leg as the machine making the requests. When I run > ab against this server I get the following: > > Concurrency Level: =A0 =A0 =A0100 > Time taken for tests: =A0 0.175542 seconds > Complete requests: =A0 =A0 =A01000 > Failed requests: =A0 =A0 =A0 =A00 > Write errors: =A0 =A0 =A0 =A0 =A0 0 > Total transferred: =A0 =A0 =A0283000 bytes > HTML transferred: =A0 =A0 =A0 45000 bytes > Requests per second: =A0 =A05696.64 [#/sec] (mean) > Time per request: =A0 =A0 =A0 17.554 [ms] (mean) > Time per request: =A0 =A0 =A0 0.176 [ms] (mean, across all concurrent req= uests) > Transfer rate: =A0 =A0 =A0 =A0 =A01572.27 [Kbytes/sec] received > > When I run the benchmark (compiling just TestHttpClient4.java) against > this server I get the following: > > Concurrency level: =A0 =A0 =A0100 > Time taken for tests: =A0 6.906 seconds > Complete requests: =A0 =A0 =A01000 > Failed requests: =A0 =A0 =A0 =A00 > Content transferred: =A0 =A045000 bytes > Requests per second: =A0 =A0144.80162 [#/sec] (mean) > > I can understand that ab might be a bit faster than HttpClient, but > going from 5K requests per second to 150 requests per second is MUCH > slower. > > I wrapped the HttpResponse response =3D httpclient.execute(request); > line with calls to System.currentTimeMillis(); and then printed the > time for the execute() function. Most of the calls are 0 - 3ms; > however there are some calls to execute() that are as high as 6,900ms! > > What could be taking almost 6 seconds to make the request? Is this the > garbage collector pausing the test? > > Thoughts? > > Environment: > > java version "1.6.0_26" > Java(TM) SE Runtime Environment (build 1.6.0_26-b03) > Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) > > Bill- > --001636eef97fd74bee04a81d4a3a Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org --001636eef97fd74bee04a81d4a3a--