Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D05EA63456D for ; Mon, 16 Mar 2009 21:18:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 85922-04-4 for ; Mon, 16 Mar 2009 21:17:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og103.obsmtp.com (exprod7og103.obsmtp.com [64.18.2.159]) by mail.postgresql.org (Postfix) with SMTP id A54BB635CBD for ; Mon, 16 Mar 2009 21:17:24 -0300 (ADT) Received: from source ([209.85.219.157]) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKSb7sErS7WoNc99Mns+S2WaSh2MeZ29ST@postini.com; Mon, 16 Mar 2009 17:17:24 PDT Received: by ewy1 with SMTP id 1so4135122ewy.5 for ; Mon, 16 Mar 2009 17:17:21 -0700 (PDT) Received: by 10.210.18.18 with SMTP id 18mr4140746ebr.53.1237249041398; Mon, 16 Mar 2009 17:17:21 -0700 (PDT) Received: from oxford.xeocode.com.enterprisedb.com ([87.127.95.198]) by mx.google.com with ESMTPS id c5sm1141441nfi.68.2009.03.16.17.17.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Mar 2009 17:17:20 -0700 (PDT) To: Greg Smith Cc: "ml\@bortal.de" , pgsql-performance@postgresql.org Subject: Re: Postgres benchmarking with pgbench In-Reply-To: (Greg Smith's message of "Mon\, 16 Mar 2009 12\:39\:43 -0400 \(EDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+imap.gmail.com:PG" 113228) References: <49BE2E84.2040506@bortal.de> <87bps132t1.fsf@oxford.xeocode.com> From: Gregory Stark Organization: EnterpriseDB Date: Tue, 17 Mar 2009 00:17:18 +0000 Message-ID: <87ljr50zqp.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200903/223 X-Sequence-Number: 33145 Greg Smith writes: > On Mon, 16 Mar 2009, Gregory Stark wrote: > >> Why would checkpoints force out any data? It would dirty those pages and then >> sync the files marking them clean, but they should still live on in the >> filesystem cache. > > The bulk of the buffer churn in pgbench is from the statement that updates a > row in the accounts table. That constantly generates updated data block and > index block pages. If you can keep those changes in RAM for a while before > forcing them to disk, you can get a lot of benefit from write coalescing that > goes away if constant checkpoints push things out with a fsync behind them. > > Not taking advantage of that effectively reduces the size of the OS cache, > because you end up with a lot of space holding pending writes that wouldn't > need to happen at all yet were the checkpoints spaced out better. Ok, so it's purely a question of write i/o, not reduced cache effectiveness. I think I could see that. I would be curious to see these results with a larger checkpoint_segments setting. Looking further at the graphs I think they're broken but not in the way I had guessed. It looks like they're *overstating* the point at which the drop occurs. Looking at the numbers it's clear that under 1GB performs well but at 1.5GBP it's already dropping to the disk-resident speed. I think pgbench is just not that great a model for real-world usage . a) most real world workloads are limited by read traffic, not write traffic, and certainly not random update write traffic; and b) most real-world work loads follow a less uniform distribution so keeping busy records and index regions in memory is more effective. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!