Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0ADCA6363F4 for ; Thu, 2 Apr 2009 17:44:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47860-05 for ; Thu, 2 Apr 2009 17:44:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-4.exch018.msoutlookonline.net (exhub018-4.exch018.msoutlookonline.net [64.78.17.19]) by mail.postgresql.org (Postfix) with ESMTP id AEB206356BD for ; Thu, 2 Apr 2009 17:44:23 -0300 (ADT) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-4.exch018.msoutlookonline.net ([64.78.17.19]) with mapi; Thu, 2 Apr 2009 13:44:22 -0700 From: Scott Carey To: Scott Carey , Merlin Moncure CC: Greg Smith , Mark Kirkwood , "pgsql-performance@postgresql.org" Date: Thu, 2 Apr 2009 13:44:20 -0700 Subject: Re: Raid 10 chunksize Thread-Topic: [PERFORM] Raid 10 chunksize Thread-Index: AcmzvK25NfeDmBgCQG+VKwO5ZOYzegAE8ENvAADXU1U= Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/49 X-Sequence-Number: 33416 On 4/2/09 1:20 PM, "Scott Carey" wrote: >=20 > 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. This holds only for RAID 0 (or 10), parit= y > 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. >=20 > Raid block sizes smaller than the postgres block is always bad and > multiplies random i/o. >=20 > 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. >=20 OK, one more thing. The 8k read In a 8MB block size raid array can generat= e two reads in the following cases: Your read is on the boundary of the blocks AND 1: your partition is not aligned with the raid blocks. This can happen if you partition _inside_ the raid but not if you raid inside the partition (the latter only being applicable to software raid). OR 2: your file system block size is smaller than the postgres block size and the file block offset is not postgres block aligned. The likelihood of the first condition is proportional to: (Postgres block size)/(raid block size) Hence, for most all setups with software raid, a larger block size up to th= e point where the above ratio gets sufficiently small is optimal. If the block size gets too large, then random access is more and more likely to bias towards one drive over the others and lower throughput. Obviously, in the extreme case where the block size is the disk size, you would have to randomly access 100% of all the data to get full speed.=20