Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9C0FC64FCFF for ; Thu, 21 Aug 2008 12:00:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 40243-03 for ; Thu, 21 Aug 2008 12:00:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.171]) by postgresql.org (Postfix) with ESMTP id B7EAF64FCE6 for ; Thu, 21 Aug 2008 12:00:20 -0300 (ADT) Received: by wf-out-1314.google.com with SMTP id 25so19810wfc.28 for ; Thu, 21 Aug 2008 08:00:18 -0700 (PDT) Received: by 10.142.212.19 with SMTP id k19mr519837wfg.13.1219330385410; Thu, 21 Aug 2008 07:53:05 -0700 (PDT) Received: by 10.143.39.19 with HTTP; Thu, 21 Aug 2008 07:53:05 -0700 (PDT) Message-ID: Date: Thu, 21 Aug 2008 07:53:05 -0700 From: "Scott Carey" To: "Christiaan Willemsen" Subject: Re: How to setup disk spindles for best performance Cc: "Joshua D. Drake" , "Merlin Moncure" , pgsql-performance@postgresql.org In-Reply-To: <48AD288B.8030902@technocon.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_49175_9437811.1219330385387" References: <972BDF1A-B4ED-46EC-B416-0CDF15A0439A@technocon.com> <331B8FD1-7460-4B97-BD2C-03D8381E1C4D@technocon.com> <48AD022E.7090400@commandprompt.com> <48AD288B.8030902@technocon.com> X-Google-Sender-Auth: 57390c741210478e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200808/252 X-Sequence-Number: 31133 ------=_Part_49175_9437811.1219330385387 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Indexes will be random write workload, but these won't by synchronous writes and will be buffered by the raid controller's cache. Assuming you're using a hardware raid controller that is, and one that doesn't have major performance problems on your platform. Which brings those questions up --- what is your RAID card and OS? For reads, if your shared_buffers is large enough, your heavily used indexes won't likely go to disk much at all. A good raid controller will typically help distribute the workload effectively on a large array. You probably want a simple 2 disk mirror or 4 disks in raid 10 for your OS + xlog, and the rest for data + indexes -- with hot spares IF your card supports them. The biggest risk to splitting up data and indexes is that you don't know how much I/O each needs relative to each other, and if this isn't a relatively constant ratio you will have one subset busy while the other subset is idle. Unless you have extensively profiled your disk activity into index and data subsets and know roughly what the optimal ratio is, its probably going to cause more problems than it fixes. Furthermore, if this ratio changes at all, its a maintenance nightmare. How much each would need in a perfect world is application dependant, so there can be no general recommendation other than: don't do it. On Thu, Aug 21, 2008 at 1:34 AM, Christiaan Willemsen < cwillemsen@technocon.com> wrote: > Thanks Joshua, > > So what about putting the indexes on a separate array? Since we do a lot of > inserts indexes are going to be worked on a lot of the time. > > Regards, > > Christiaan > > > Joshua D. Drake wrote: > >> Christiaan Willemsen wrote: >> >>> So, what you are basically saying, is that a single mirror is in general >>> more than enough to facilitate the transaction log. >>> >> >> >> http://www.commandprompt.com/blogs/joshua_drake/2008/04/is_that_performance_i_smell_ext2_vs_ext3_on_50_spindles_testing_for_postgresql/ >> http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_Tuning_Guide >> >> And to answer your question, yes. Transaction logs are written >> sequentially. You do not need a journaled file system and raid 1 is plenty >> for most if not all work loads. >> >> Sincerely, >> >> Joshua D. Drake >> >> > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > ------=_Part_49175_9437811.1219330385387 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Indexes will be random write workload, but these won't by synchronous writes and will be buffered by the raid controller's cache.  Assuming you're using a hardware raid controller that is, and one that doesn't have major performance problems on your platform.  Which brings those questions up --- what is your RAID card and OS?

For reads, if your shared_buffers is large enough, your heavily used indexes won't likely go to disk much at all.

A good raid controller will typically help distribute the workload effectively on a large array.

You probably want a simple 2 disk mirror or 4 disks in raid 10 for your OS + xlog, and the rest for data + indexes -- with hot spares IF your card supports them.

The biggest risk to splitting up data and indexes is that you don't know how much I/O each needs relative to each other, and if this isn't a relatively constant ratio you will have one subset busy while the other subset is idle.
Unless you have extensively profiled your disk activity into index and data subsets and know roughly what the optimal ratio is, its probably going to cause more problems than it fixes. 
Furthermore, if this ratio changes at all, its a maintenance nightmare.  How much each would need in a perfect world is application dependant, so there can be no general recommendation other than:  don't do it.

On Thu, Aug 21, 2008 at 1:34 AM, Christiaan Willemsen <cwillemsen@technocon.com> wrote:
Thanks Joshua,

So what about putting the indexes on a separate array? Since we do a lot of inserts indexes are going to be worked on a lot of the time.

Regards,

Christiaan


Joshua D. Drake wrote:
Christiaan Willemsen wrote:
So, what you are basically saying, is that a single mirror is in general more than enough to facilitate the transaction log.

http://www.commandprompt.com/blogs/joshua_drake/2008/04/is_that_performance_i_smell_ext2_vs_ext3_on_50_spindles_testing_for_postgresql/
http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_Tuning_Guide

And to answer your question, yes. Transaction logs are written sequentially. You do not need a journaled file system and raid 1 is plenty for most if not all work loads.

Sincerely,

Joshua D. Drake


--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

------=_Part_49175_9437811.1219330385387--