From owner-freebsd-performance@FreeBSD.ORG Sat Apr 21 23:10:57 2007 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F83216A401 for ; Sat, 21 Apr 2007 23:10:57 +0000 (UTC) (envelope-from gofp-freebsd-performance@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 10B2213C448 for ; Sat, 21 Apr 2007 23:10:56 +0000 (UTC) (envelope-from gofp-freebsd-performance@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HfOjB-0002Pt-UT for freebsd-performance@freebsd.org; Sun, 22 Apr 2007 01:10:49 +0200 Received: from 89-172-36-120.adsl.net.t-com.hr ([89.172.36.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Apr 2007 01:10:49 +0200 Received: from ivoras by 89-172-36-120.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Apr 2007 01:10:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-performance@freebsd.org From: Ivan Voras Date: Sun, 22 Apr 2007 01:10:35 +0200 Lines: 105 Message-ID: References: <462A31A9.5080207@FreeBSD-BG.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC93FCD43AD7C96A493EF15E7" X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 89-172-36-120.adsl.net.t-com.hr User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) In-Reply-To: <462A31A9.5080207@FreeBSD-BG.org> X-Enigmail-Version: 0.94.3.0 Sender: news Subject: Re: apache httpd performance X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2007 23:10:57 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC93FCD43AD7C96A493EF15E7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cheffo wrote: > What else I can change/test to improve performance? First you'll have to give more info about the hardware on both systems, and the way you benchmarked them (e.g. did you benchmark over ethernet or from the same machine?). There are also a bunch of things that may make apache go faster/slower, for example DNS resolving for the logs, rewrite rules, etc. - you should test with (as much as they can be) identical configurations. On a slow-ish 2 CPU Pentium3 server, over gigabit network (remote client), I get: Server Software: Apache/2.2.3 Server Port: 80 Document Path: /file.txt Document Length: 9500 bytes Concurrency Level: 100 Time taken for tests: 27.300259 seconds Complete requests: 50000 Failed requests: 0 Write errors: 0 Total transferred: 489226808 bytes HTML transferred: 475025956 bytes Requests per second: 1831.48 [#/sec] (mean) Time per request: 54.601 [ms] (mean) Time per request: 0.546 [ms] (mean, across all concurrent requests)= Transfer rate: 17500.20 [Kbytes/sec] received On the same server, ab running locally, I get: Server Software: Apache/2.2.3 Server Port: 80 Document Path: /file.txt Document Length: 9500 bytes Concurrency Level: 100 Time taken for tests: 30.8557 seconds Complete requests: 29194 Failed requests: 6 (Connect: 6, Length: 0, Exceptions: 0) Write errors: 0 Total transferred: 286117856 bytes HTML transferred: 277811424 bytes Requests per second: 972.86 [#/sec] (mean) Time per request: 102.790 [ms] (mean) Time per request: 1.028 [ms] (mean, across all concurrent requests)= Transfer rate: 9311.04 [Kbytes/sec] received (Yes, this is a different version of apache than yours, but I'm illustrating a point :) ) Some more data points: - Remote client, apache, using keepalives: Requests per second: 2891.61 [#/sec] (mean) Time per request: 34.583 [ms] (mean) Time per request: 0.346 [ms] (mean, across all concurrent requests)= Transfer rate: 27729.00 [Kbytes/sec] received - Remote client, using thttpd instead of apache (keepalives have no influence here): Requests per second: 3728.68 [#/sec] (mean) Time per request: 26.819 [ms] (mean) Time per request: 0.268 [ms] (mean, across all concurrent requests)= Transfer rate: 35499.92 [Kbytes/sec] received Regarding this last one: It seems that FreeBSD really benefits from using 2 CPUs here. thttpd is a single-threaded async server, but the load on the machine shows cca 10% idle. Thttpd gets ~~45%, swi:net gets 45%, irq20:bge0 gets 20%, syslogd gets 5% and the rest goes where top can't follow. It looks like ipfw might be one of the limiting factors here (I use dynamic rules and the log shows ipfw discarding packets that look valid). --------------enigC93FCD43AD7C96A493EF15E7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGKpnrldnAQVacBcgRAmueAKDtJ9KllCn8jYbAuDRSYC+IkSuzcQCghMsm gUtcsV9tulu8pyTdGKYpr2k= =MdsL -----END PGP SIGNATURE----- --------------enigC93FCD43AD7C96A493EF15E7--