From: | Greg Smith <gsmith(at)gregsmith(dot)com> |
---|---|
To: | Guillaume Cottenceau <gc(at)mnc(dot)ch> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Choosing a filesystem |
Date: | 2008-09-12 09:11:45 |
Message-ID: | Pine.GSO.4.64.0809120450430.6489@westnet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Fri, 12 Sep 2008, Guillaume Cottenceau wrote:
> Out of the blue, is it just because when postgresql fsync's after a
> write, on a normal system the write has to really happen on disk and
> waiting for it to be complete, whereas with BBU cache the fsync is
> almost immediate because the write cache actually replaces the "really
> on disk" write?
That's the main thing, and nothing else you can do will accelerate that.
Without a useful write cache (which usually means RAM with a BBU), you'll
at best get about 100-200 write transactions per second for any one
client, and something like 500/second even with lots of clients (queued up
transaction fsyncs do get combined). Those numbers increase to several
thousand per second the minute there's a good caching controller in the
mix.
You might say "but I don't write that heavily, so what?" Even if the
write volume is low enough that the disk can keep up, there's still
latency. A person who is writing transactions is going to be delayed a
few milliseconds after each commit, which drags some types of data loading
to a crawl. Also, without a cache in places mixes of fsync'd writes and
reads can behave badly, with readers getting stuck behind writers much
more often than in the cached situation.
The final factor is that additional layers of cache usually help improve
physical grouping of blocks into ordered sections to lower seek overhead.
The OS is supposed to be doing that for you, but a cache closer to the
drives themselves helps smooth things out when the OS dumps a large block
of data out for some reason. The classic example in PostgreSQL land,
particularly before 8.3, was when a checkpoint happens.
--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD
From | Date | Subject | |
---|---|---|---|
Next Message | George McCollister | 2008-09-12 14:13:13 | Postgres Performance on CPU limited Platforms |
Previous Message | James Mansion | 2008-09-12 09:05:49 | Re: Effects of setting linux block device readahead size |