pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dawid Kuroczko <qnex42@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: What's the best hardver for PostgreSQL 8.1?
Date: Tue, 27 Dec 2005 08:24:45 +0100
Message-ID: <758d5e7f0512262324i4dccd6bbs87d80e59eb776a8@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0512261004230.2807@qnivq.ynat.uz>
References: <43A84D03.7090002@ritek.hu>
	<200512212209.50234.caseroj@comcast.net>
	<200512212231.55100.caseroj@comcast.net>
	<20051224135042.484c6e32.frank@wiles.org>
	<6.2.5.6.0.20051224161551.01dc5d98@earthlink.net>
	<Pine.LNX.4.62.0512241350010.2807@qnivq.ynat.uz>
	<6.2.5.6.0.20051224172653.01dd4c08@earthlink.net>
	<20051225173755.GA6986@mathom.us>
	<33c6269f0512260932g38c9b7a4uc2aba00f72ff77@mail.gmail.com>
	<Pine.LNX.4.62.0512261004230.2807@qnivq.ynat.uz>

On 12/26/05, David Lang <dlang@invendra.net> wrote:
> raid5 writes n+1 blocks not n+n/2 (unless n=2 for a 3-disk raid). you can
> have a 15+1 disk raid5 array for example
>
> however raid1 (and raid10) have to write 2*n blocks to disk. so if you are
> talking about pure I/O needed raid5 wins hands down. (the same 16 drives
> would be a 8+8 array)
>
> what slows down raid 5 is that to modify a block you have to read blocks
> from all your drives to re-calculate the parity. this interleaving of
> reads and writes when all you are logicly doing is writes can really hurt.
> (this is why I asked the question that got us off on this tangent, when
> doing new writes to an array you don't have to read the blocks as they are
> blank, assuming your cacheing is enough so that you can write blocksize*n
> before the system starts actually writing the data)

Not exactly true.

Let's assume you have a 4+1 RAID5 (drives A, B, C, D and E),
and you want to update drive A.  Let's assume the parity
is stored in this particular write on drive E.

One way to write it is:
 write A,
 read A, B, C, D,
 combine A+B+C+D and write it E.
 (4 reads + 2 writes)

The other way to write it is:
 read oldA,
 read old parity oldE
 write newA,
 write E = oldE + (newA-oldA) -- calculate difference between new and
old A, and apply it to old parity, then write
 (2 reads + 2 writes)

The more drives you have, the smarter it is to use the second approach,
unless of course A, B, C and D are available in the cache, which is the
niciest situation.

   Regards,
       Dawid



view thread (54+ messages)  latest in thread

Message-ID: <758d5e7f0512262324i4dccd6bbs87d80e59eb776a8@mail.gmail.com>
Permalink:  ../758d5e7f0512262324i4dccd6bbs87d80e59eb776a8@mail.gmail.com/
Also on:    postgresql.org/message-id/758d5e7f0512262324i4dccd6bbs87d80e59eb776a8@mail.gmail.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: qnex42@gmail.com
  Subject: Re: What's the best hardver for PostgreSQL 8.1?
  In-Reply-To: <758d5e7f0512262324i4dccd6bbs87d80e59eb776a8@mail.gmail.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