X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 74ACDD781A for ; Sun, 20 Nov 2005 10:22:45 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83439-08 for ; Sun, 20 Nov 2005 14:22:48 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id DE239D77D6 for ; Sun, 20 Nov 2005 10:22:42 -0400 (AST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1Edq5Z-0003EU-00; Sun, 20 Nov 2005 09:22:41 -0500 To: Alan Stange Cc: Luke Lonergan , Greg Stark , Dave Cramer , Joshua Marsh , pgsql-performance@postgresql.org Subject: Re: Hardware/OS recommendations for large databases ( References: <437FE2E4.5040600@rentec.com> In-Reply-To: <437FE2E4.5040600@rentec.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 20 Nov 2005 09:22:41 -0500 Message-ID: <87y83jo0um.fsf@stark.xeocode.com> Lines: 34 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/411 X-Sequence-Number: 15668 Alan Stange writes: > > Iowait is time spent waiting on blocking io calls. As another poster > > pointed out, you have a two CPU system, and during your scan, as predicted, > > one CPU went 100% busy on the seq scan. During iowait periods, the CPU can > > be context switched to other users, but as I pointed out earlier, that's not > > useful for getting response on decision support queries. I don't think that's true. If the syscall was preemptable then it wouldn't show up under "iowait", but rather "idle". The time spent in iowait is time in uninterruptable sleeps where no other process can be scheduled. > iowait time is idle time. Period. This point has been debated endlessly for > Solaris and other OS's as well. > > Here's the man page: > %iowait > Show the percentage of time that the CPU or CPUs were > idle during which the system had an outstanding disk I/O > request. > > If the system had some other cpu bound work to perform you wouldn't ever see > any iowait time. Anyone claiming the cpu was 100% busy on the sequential scan > using the one set of numbers I posted is misunderstanding the actual metrics. That's easy to test. rerun the test with another process running a simple C program like "main() {while(1);}" (or two invocations of that on your system because of the extra processor). I bet you'll see about half the percentage of iowait because postres will get half as much opportunity to schedule i/o. If what you are saying were true then you should get 0% iowait. -- greg