X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0C903D1E5C4 for ; Tue, 4 May 2004 09:06:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 17535-07 for ; Tue, 4 May 2004 09:06:07 -0300 (ADT) Received: from hotmail.com (bay18-dav5.bay18.hotmail.com [65.54.187.185]) by svr1.postgresql.org (Postfix) with ESMTP id C226ED1B4A3 for ; Tue, 4 May 2004 09:06:03 -0300 (ADT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 4 May 2004 05:06:07 -0700 Received: from 67.81.102.201 by bay18-dav5.bay18.hotmail.com with DAV; Tue, 04 May 2004 12:06:06 +0000 X-Originating-IP: [67.81.102.201] X-Originating-Email: [awerman2@hotmail.com] X-Sender: awerman2@hotmail.com From: "Aaron Werman" To: "Alan Stange" Cc: References: <407E25A6.ADFE4815@t1.unisoftbg.com> <407E909F.9000101@ehpg.net> <1082053706.10823.38.camel@localhost.localdomain> <40970058.3040608@selectacast.net> <4097081B.7020006@rentec.com> Subject: Re: linux distro for better pg performance Date: Tue, 4 May 2004 08:06:22 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: X-OriginalArrivalTime: 04 May 2004 12:06:07.0134 (UTC) FILETIME=[2E3413E0:01C431D0] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/22 X-Sequence-Number: 6853 The comparison is actually dead on. If you have lots of write through / read behind cache, RAID 5 can run very quickly, until the write rate overwhelms the cache - at which point the 4 I/O per write / 2 per read stops it. This means that RAID 5 works, except when stressed, which is a bad paradigm. If you do streaming sequential writes on RAID5 on a 4 drive RAID5, 4 writes become: - read drive 1 for data - read drive 3 for parity - write changes to drive 1 - write changes to drive 3 - read drive 2 for data - read drive 4 for parity - write changes to drive 2 - write changes to drive 4 - read drive 3 for data - read drive 1 for parity - write changes to drive 3 - write changes to drive 1 - read drive 4 for data - read drive 2 for parity - write changes to drive 4 - write changes to drive 2 or drive 1: 2 reads, 2 writes drive 2: 2 reads, 2 writes drive 3: 2 reads, 2 writes drive 4: 2 reads, 2 writes in other words, evenly distributed 16 I/Os. These have to be ordered to be recoverable (otherwise the parity scheme is broken and you can't recover), and thus are quasi synchronous. The same on RAID 10 is - write changes to drive 1 - write copy of changes to drive 2 - write changes to drive 1 - write copy of changes to drive 2 - write changes to drive 1 - write copy of changes to drive 2 - write changes to drive 1 - write copy of changes to drive 2 or drive 1: 4 I/Os drive 2: 4 I/Os in other words 4 I/Os in parallel. There is no wait on streaming I/O on RAID 10, and this fact is the other main reason RAID 10 gives an order of magnitude better performance. If you are writing full blocks in a streaming mode, RAID 3 will be the fastest - it is RAID 0 with a parity drive. In every situation I've seen it, RAID 5 was either generally slow or got applications into trouble during stress: bulk loads, etc. Most DBAs end up on RAID 10 for it's predictability and performance. /Aaron ----- Original Message ----- From: "Alan Stange" To: "Joseph Shraibman" Cc: "J. Andrew Rogers" ; Sent: Monday, May 03, 2004 11:03 PM Subject: Re: [PERFORM] linux distro for better pg performance > Joseph Shraibman wrote: > > > J. Andrew Rogers wrote: > > > >> Do these features make a difference? Far more than you would > >> imagine. On one postgres server I just upgraded, we went from a 3Ware > >> 8x7200-RPM > >> RAID-10 configuration to an LSI 320-2 SCSI 3x10k RAID-5, with 256M > > > > Is raid 5 much faster than raid 10? On a 4 disk array with 3 data > > disks and 1 parity disk, you have to write 4/3rds the original data, > > while on raid 10 you have to write 2 times the original data, so > > logically raid 5 should be faster. > > I think this comparison is a bit simplistic. For example, most raid5 > setups have full stripes that are more than 8K (the typical IO size in > postgresql), so one might have to read in portions of the stripe in > order to compute the parity. The needed bits might be in some disk or > controller cache; if it's not then you lose. If one is able to > perform full stripe writes then the raid5 config should be faster for > writes. > > Note also that the mirror has 2 copies of the data, so that the read IOs > would be divided across 2 (or more) spindles using round robin or a more > advanced algorithm to reduce seek times. > > Of course, I might be completely wrong... > > -- Alan > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >