Re: BBU Cache vs. spindles

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, James Mansion <james(at)mansionfamily(dot)plus(dot)com>, Greg Smith <greg(at)2ndquadrant(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Bruce Momjian <bruce(at)momjian(dot)us>, jd(at)commandprompt(dot)com, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Steve Crawford <scrawford(at)pinpointresearch(dot)com>, pgsql-performance(at)postgresql(dot)org, Ben Chobot <bench(at)silentmedia(dot)com>
Subject: Re: BBU Cache vs. spindles
Date: 2010-10-29 16:44:06
Message-ID: AANLkTinZ3Vy55ULrQvX_m2J7p0=A59B7hbANVXOv1z1P@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-www

On Fri, Oct 29, 2010 at 11:56 AM, Aidan Van Dyk <aidan(at)highrise(dot)ca> wrote:
> 1) The pages you write to must be in the page cache, or your memcpy is
> going to fault them in.  With a plain write, you don't need the
> over-written page in the cache.

I seem to remember a time many years ago when I got bitten by this
problem. The fact that our I/O is in 8K pages means this could be a
pretty severe hit, I think.

> 2) Now, instead of the torn-page problem being FS block/sector sized
> base, you can now actually have a possibly arbitrary amount of the
> block memory written when the kernel writes out the page.  you
> *really* need full-page-writes.

Yeah.

> 3) The mmap overhead required for the kernel to setup the mappings is
> less than the repeated syscalls of a simple write().

You'd expect to save something from that; but on the other hand, at
least on 32-bit systems, there's a very limited number of 1GB files
that can be simultaneously mapped into one address space, and it's a
lot smaller than the number of file descriptors that you can have
open. Rumor has it that cutting down the number of fds that can stay
open simultaneously is pretty bad for performance, so cutting it down
to a number you can count on one hand (maybe one finger) would
probably be bad. Maybe on 64-bit it would be OK but it seems like an
awful lot of complexity for at most a minor savings (and a pretty bad
anti-savings if point #1 kicks in).

Anyway this is all totally off-topic...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message A.M. 2010-10-29 17:05:48 Re: MVCC and Implications for (Near) Real-Time Application
Previous Message Jon Nelson 2010-10-29 16:40:24 typoed column name, but postgres didn't grump

Browse pgsql-www by date

  From Date Subject
Next Message Robert Haas 2010-10-29 18:13:31 Fwd: failure notice
Previous Message Tom Lane 2010-10-29 15:57:06 Re: BBU Cache vs. spindles