From owner-freebsd-questions@FreeBSD.ORG Thu Jun 5 20:53:17 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 996BE1065675 for ; Thu, 5 Jun 2008 20:53:17 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E95F78FC1A; Thu, 5 Jun 2008 20:53:16 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <4848523E.2010604@FreeBSD.org> Date: Thu, 05 Jun 2008 22:53:18 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Kirk Strauser References: <200806051508.29424.kirk@strauser.com> In-Reply-To: <200806051508.29424.kirk@strauser.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Poor read() performance, and I can't profile it X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2008 20:53:17 -0000 Kirk Strauser wrote: > I'm running a command (dumprecspg from my XBaseToPg project) on a FreeBSD 7 > server. I've noticed that throughput on that program is a lot lower than I > would have expected, and further investigation found it spending most of its > time in the kernel, presumably in read() [1]. > > I was testing the same software on my desktop PC when I noticed that it ran > *much* faster, and found that it was spending only about 1% as much time in > the kernel on Linux as it was on FreeBSD. > > I ran a quick-and-dirty comparison of the same software on two different > machines, the FreeBSD server being by far the more powerful of the two. I > ran the same command on both machines from various filesystems (to rule out > differences in drive performance), and posted the output of zsh's "time" > command for the fastest run in each setting. The results are below. > > Any ideas what could be causing this horrible performance? I'm willing to > try just about anything. ktrace(1) and check for the buffer size in use. It is probably too small. Kris