pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: stange@rentec.com
Cc: Luke Lonergan <llonergan@greenplum.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Joshua Marsh <icub3d@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Hardware/OS recommendations for large databases (
Date: 21 Nov 2005 14:01:26 -0500
Message-ID: <87ek59omex.fsf@stark.xeocode.com> (raw)
In-Reply-To: <4381E077.80009@rentec.com>
References: <BFA6C187.1425C%llonergan@greenplum.com>
	<4381E077.80009@rentec.com>


Alan Stange <stange@rentec.com> writes:

> The point your making doesn't match my experience with *any* storage or program
> I've ever used, including postgresql.   Your point suggests that the storage
> system is idle  and that postgresql is broken because it isn't able to use the
> resources available...even when the cpu is very idle.  How can that make sense?

Well I think what he's saying is that Postgres is issuing a read, then waiting
for the data to return. Then it does some processing, and goes back to issue
another read. The CPU is idle half the time because Postgres isn't capable of
doing any work while waiting for i/o, and the i/o system is idle half the time
while the CPU intensive part happens.

(Consider as a pathological example a program that reads 8k then sleeps for
10ms, and loops doing that 1,000 times. Now consider the same program
optimized to read 8M asynchronously and sleep for 10s. By the time it's
finished sleeping it has probably read in all 8M. Whereas the program that
read 8k in little chunks interleaved with small sleeps would probably take
twice as long and appear to be entirely i/o-bound with 50% iowait and 50%
idle.)

It's a reasonable theory and it's not inconsistent with the results you sent.
But it's not exactly proven either. Nor is it clear how to improve matters.
Adding additional threads to handle the i/o adds an enormous amount of
complexity and creates lots of opportunity for other contention that could
easily eat all of the gains.

I also fear that heading in that direction could push Postgres even further
from the niche of software that works fine even on low end hardware into the
realm of software that only works on high end hardware. It's already suffering
a bit from that.

-- 
greg




view thread (173+ messages)  latest in thread

Message-ID: <87ek59omex.fsf@stark.xeocode.com>
Permalink:  ../87ek59omex.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87ek59omex.fsf@stark.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gsstark@mit.edu, stange@rentec.com, llonergan@greenplum.com, pg@fastcrypt.com, icub3d@gmail.com
  Subject: Re: Hardware/OS recommendations for large databases (
  In-Reply-To: <87ek59omex.fsf@stark.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox