Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4A0EE632F09 for ; Thu, 2 Apr 2009 17:27:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81502-05 for ; Thu, 2 Apr 2009 17:27:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f169.google.com (mail-bw0-f169.google.com [209.85.218.169]) by mail.postgresql.org (Postfix) with ESMTP id 419C163261B for ; Thu, 2 Apr 2009 17:27:08 -0300 (ADT) Received: by bwz17 with SMTP id 17so1055870bwz.19 for ; Thu, 02 Apr 2009 13:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jMZ4UHbCs456SJMABBN6ksP0nONeg92+bNYNIIAILDM=; b=mJTP56krshaYeDcCj4cP9T38byct8XK0f73ax1RUxSO3DDQA9vXB0YsU6LYbVEymjK 4Ygnly+tWn5Wa2GAOKqxB/KNBqy8rKMNIi9N3fOhK8VnNzh0zJMRehTntDUVbzVq0EQC 2EwV5Lzekt+xzpXa3jrSNA7xK825qWrsz0Ijk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=DZeR6TclKkHHbixysHxvccMEeTYHSjVbws+heJuIYchCSeWf3gAvMLYKEty/msY8V6 5AcWSci8X6cIqwqvz8/z8VFkUukYJneUAG7DSn0TEO13mov3gXbZElqGRiRUIA5kGnh0 cexl/9Vbkqi9M7GSGPKB+HR0Rj+xv4bGpfLDg= MIME-Version: 1.0 Received: by 10.103.91.2 with SMTP id t2mr204821mul.47.1238704026870; Thu, 02 Apr 2009 13:27:06 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Apr 2009 16:27:06 -0400 Message-ID: Subject: Re: Raid 10 chunksize From: Merlin Moncure To: Scott Carey Cc: Greg Smith , Mark Kirkwood , "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.08 tagged_above=0 required=5 tests=AWL=0.080 X-Spam-Level: X-Archive-Number: 200904/47 X-Sequence-Number: 33414 On Thu, Apr 2, 2009 at 4:20 PM, Scott Carey wrote= : > > On 4/2/09 10:58 AM, "Merlin Moncure" wrote: > >> On Wed, Mar 25, 2009 at 12:16 PM, Scott Carey = wrote: >>> On 3/25/09 1:07 AM, "Greg Smith" wrote: >>>> On Wed, 25 Mar 2009, Mark Kirkwood wrote: >>>>> I'm thinking that the raid chunksize may well be the issue. >>>> >>>> Why? =A0I'm not saying you're wrong, I just don't see why that paramet= er >>>> jumped out as a likely cause here. >>>> >>> >>> If postgres is random reading or writing at 8k block size, and the raid >>> array is set with 4k block size, then every 8k random i/o will create T= WO >>> disk seeks since it gets split to two disks. =A0 Effectively, iops will= be cut >>> in half. >> >> I disagree. =A0The 4k raid chunks are likely to be grouped together on >> disk and read sequentially. =A0This will only give two seeks in special >> cases. > > By definition, adjacent raid blocks in a stripe are on different disks. > > >> Now, if the PostgreSQL block size is _smaller_ than the raid >> chunk size, =A0random writes can get expensive (especially for raid 5) >> because the raid chunk has to be fully read in and written back out. >> But this is mainly a theoretical problem I think. > > This is false and a RAID-5 myth. =A0New parity can be constructed from th= e old > parity + the change in data. =A0Only 2 blocks have to be accessed, not th= e > whole stripe. > > Plus, this was about RAID 10 or 0 where parity does not apply. > >> >> I'm going to go out on a limb and say that for block sizes that are >> within one or two 'powers of two' of each other, it doesn't matter a >> whole lot. =A0SSDs might be different, because of the 'erase' block >> which might be 128k, but I bet this is dealt with in such a fashion >> that you wouldn't really notice it when dealing with different block >> sizes in pg. > > Well, raid block size can be significantly larger than postgres or file > system block size and the performance of random reads / writes won't get > worse with larger block sizes. =A0This holds only for RAID 0 (or 10), par= ity > is the ONLY thing that makes larger block sizes bad since there is a > read-modify-write type operation on something the size of one block. > > Raid block sizes smaller than the postgres block is always bad and > multiplies random i/o. > > Read a 8k postgres block in a 8MB md raid 0 block, and you read 8k from o= ne > disk. > Read a 8k postgres block on a md raid 0 with 4k blocks, and you read 4k f= rom > two disks. yep...that's good analysis...thinko on my part. merlin