From owner-freebsd-current@FreeBSD.ORG Thu May 18 19:42:45 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC9CE16A403 for ; Thu, 18 May 2006 19:42:45 +0000 (UTC) (envelope-from ivoras@fer.hr) Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2B6143D45 for ; Thu, 18 May 2006 19:42:44 +0000 (GMT) (envelope-from ivoras@fer.hr) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.6/8.13.4) with ESMTP id k4IJgKGg054134 for ; Thu, 18 May 2006 21:42:21 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <446CCE1C.1050200@fer.hr> Date: Thu, 18 May 2006 21:42:20 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050921) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "current@freebsd.org" Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: (Another) simple benchmark X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2006 19:42:46 -0000 Today I had the opportunity to experiment for a short time with a 4-CPU Xeon machine with hyperthreading (-> 8 logical CPU-s) and 3GB RAM. In absence of anything smarter to do, I installed WBEL 3 Linux (non-RedHat version of RedHat Enterprise Linux) which was accidentally on the table and after toying around I've run a simple benchmark - ab (apachebench, included by default with apache server) over localhost to a local apache2 server, on a static home-page file. The command line was "ab -n 100000 -c 100 http://localhost/". Since I still had time with the machine, I then downloaded and installed FreeBSD 6.1 to try to beat the score. Unfortunately, not only I couldn't beat the score, but the results were *extremely* bad. Since I'm still not sure it isn't my fault, I won't post the actual results, but I wonder... Apache is a well known server-grade product, which doesn't use threading (it was preforked in both systems), doesn't call gettimeofday() constantly, uses sendfile(), and in short, is very different from MySQL. It shouldn't behave this badly on FreeBSD. Some observations from the benchmark runs: - Linux was maxed out with ~50% total idle time, each logical processor (hyperthreading was enabled) had ~25% user + ~25% sys time. It still delivered order-of-magnitude better results. WBEL3 uses Linux 2.4.x kernel (i.e. old kernel) - FreeBSD CPU time was 100% spent, with 90%-95% spent in sys time - On FreeBSD, enabling hyperthreading got me a slowdown of *4x* over the initial (bad) results (some slowdown is not surprising, 4x slowdown is). - Linux "load average" never went above 8, FreBSD's went > 60; this could be just a difference in accounting, or it could not - I don't know. What is needed to reproduce this simple benchmark: - SMP machine, the more CPUs the better - installed software: only apache20. The "ab" benchmark is included in it. Leave apache's default configuration as-is (i.e. preforked, max 150 parallel clients allowed) - A simple static HTML page (Apache's default "welcome, but this site is not configured" should be ok). - my invocation of "ab" was with "-n 100000 -c 100" ; the (n)umber of requests could be modified to fit local CPU speed, but (c)oncurrency shouldn't (100 parallel requests is not uncommon). Since I didn't have time to reinstall Linux to check if apache's configuration was the same in all important things all this may be bogus, but if anyone has a spare box with several CPUs, I'd be interested in results. p.s. I don't think the actual Linux kernel version matters here, any 2.4 or newer will do.