Skip site navigation (1) Skip section navigation (2)

Re: BBU Cache vs. spindles

From: Scott Carey <scott(at)richrelevance(dot)com>
To: Rob Wultsch <wultsch(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Greg Smith<greg(at)2ndquadrant(dot)com>, "jd(at)commandprompt(dot)com" <jd(at)commandprompt(dot)com>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Steve Crawford <scrawford(at)pinpointresearch(dot)com>, "pgsql-performance(at)postgresql(dot)org"<pgsql-performance(at)postgresql(dot)org>, Ben Chobot <bench(at)silentmedia(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BBU Cache vs. spindles
Date: 2010-10-26 07:22:44
Message-ID: A1D6CCC4-1E8A-4001-96CF-98DEA3F2DA70@richrelevance.com (view raw or flat)
Thread:
Lists: pgsql-performancepgsql-www
On Oct 22, 2010, at 1:06 PM, Rob Wultsch wrote:

> On Fri, Oct 22, 2010 at 12:05 PM, Kevin Grittner
> <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
>> Rob Wultsch <wultsch(at)gmail(dot)com> wrote:
>> 
>>> I would think full_page_writes=off + double write buffer should be
>>> far superior, particularly given that the WAL is shipped over the
>>> network to slaves.
>> 
>> For a reasonably brief description of InnoDB double write buffers, I
>> found this:
>> 
>> http://www.mysqlperformanceblog.com/2006/08/04/innodb-double-write/
>> 
>> One big question before even considering this would by how to
>> determine whether a potentially torn page "is inconsistent".
>> Without a page CRC or some such mechanism, I don't see how this
>> technique is possible.
>> 
>> Even if it's possible, it's far from clear to me that it would be an
>> improvement.  The author estimates (apparently somewhat loosely)
>> that it's a 5% to 10% performance hit in InnoDB; I'm far from
>> certain that full_page_writes cost us that much.  Does anyone have
>> benchmark numbers handy?
>> 
>> -Kevin
>> 
> 
> Ignoring (briefly) the cost in terms of performance of the different
> system, not needing full_page_writes would make geographically
> dispersed replication possible for certain cases where it is not
> currently (or at least rather painful)..

Am I missing something here?

Can't the network replication traffic be partial pages, but the WAL log on the slave (and master) be full pages?  In other words, the slave can transform a partial page update into a full page xlog entry.


(optional) 1. Log partial pages received from master to disk. (not xlog, something else, useful to persist changes faster)
2. Read page from disk for update.
3. Log full page modification to xlog for local commit.
4. Update page in memory and write out to OS as usual.

The lack of the full page from the master would mean that you have to do a read-modify-write rather than just overwrite, but I think that works fine if network bandwidth is your bottleneck.
I don't know enough of the guts of Postgres to be certain, but it seems conceptually like this is possible. 

Also one could use lzo compression and get a likely factor of two space saving with small CPU cost.

> 
> -- 
> Rob Wultsch
> wultsch(at)gmail(dot)com
> 
> -- 
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance


In response to

pgsql-performance by date

Next:From: AI RummanDate: 2010-10-26 10:56:48
Subject: which one is faster
Previous:From: Damon SnyderDate: 2010-10-25 23:27:42
Subject: Re: Stored procedure declared as VOLATILE => no good optimization is done

pgsql-www by date

Next:From: Robert HaasDate: 2010-10-26 12:41:13
Subject: Re: BBU Cache vs. spindles
Previous:From: Tom LaneDate: 2010-10-24 20:40:19
Subject: Re: BBU Cache vs. spindles

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group