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 9B26FD7D62 for ; Sun, 20 Nov 2005 14:10:35 -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 14460-06 for ; Sun, 20 Nov 2005 18:10:34 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.9]) by svr1.postgresql.org (Postfix) with ESMTP id C9764D7A41 for ; Sun, 20 Nov 2005 14:10:31 -0400 (AST) Received: from ram.rentec.com (mailhost [192.5.35.66]) by unicorn.rentec.com (8.13.1/8.12.1) with ESMTP id jAKIA7El011087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Nov 2005 13:10:08 -0500 (EST) X-Source: non-mednet Received: from [172.16.160.106] (stangesun.rentec.com [172.16.160.106]) by ram.rentec.com (8.13.1/8.12.1) with ESMTP id jAKI9Y7u014332; Sun, 20 Nov 2005 13:09:35 -0500 (EST) Message-ID: <4380BBC2.7060109@rentec.com> Date: Sun, 20 Nov 2005 13:09:06 -0500 From: Alan Stange User-Agent: Thunderbird 1.5 (X11/20051025) MIME-Version: 1.0 To: Greg Stark CC: Luke Lonergan , Dave Cramer , Joshua Marsh , pgsql-performance@postgresql.org Subject: Re: Hardware/OS recommendations for large databases ( References: <437FE2E4.5040600@rentec.com> <87y83jo0um.fsf@stark.xeocode.com> In-Reply-To: <87y83jo0um.fsf@stark.xeocode.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as jAKIA7El011087 at Sun Nov 20 13:10:08 2005 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.01 required=5 tests=[AWL=0.010] X-Spam-Score: 0.01 X-Spam-Level: X-Archive-Number: 200511/413 X-Sequence-Number: 15670 Greg Stark wrote: > 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. > That would be wrong. The time spent in iowait is idle time. The iowait stat would be 0 on a machine with a compute bound runnable process available for each cpu. Come on people, read the man page or look at the source code. Just stop making stuff up. > >> 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. Yes, I did this once about 10 years ago. But instead of saying "I bet" and guessing at the result, you should try it yourself. Without guessing, I can tell you that the iowait time will go to 0%. You can do this loop in the shell, so there's no code to write. Also, it helps to do this with the shell running at a lower priority. -- Alan