Re: Storage location of temporary files

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: Christian Schröder <cs(at)deriva(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storage location of temporary files
Date: 2008-11-05 23:14:58
Message-ID: dcc563d10811051514x613e83eeud18485c030fb5482@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2008/11/5 Christian Schröder <cs(at)deriva(dot)de>:
> Tomasz Ostrowski wrote:
>>
>> This is wrong. RAID5 is slower than RAID1.
>> You should go for RAID1+0 for fast and reliable storage. Or RAID0 for
>> even faster but unreliable.
>>
>
> I did not find a clear statement about this. I agree that RAID10 would be
> better than RAID5, but in some situations RAID5 at least seems to be faster
> than RAID1.

For certain read heavy loads RAID-5 will beat RAID-1 handily. After
all, from a read only perspective, a healthy RAID-5 with n disks is
equal to a healthy RAID-0 with n-1 disks. However, writes are much
more costly on RAID-5

> If I have 5 disks available, how should I use them to get best performance
> without the risk of severe data loss? If I use 4 of the disks to build a
> RAID10 then I will have only 1 remaining drive, e.g. to put the pgsql_tmp
> directories there. In this scenario I would not have the WAL on a separate
> disk.

How you use your disks depends very much on your RAID controller and
your workload. On a fast controller with battery backed cache, I'd
normally create a 4 disk RAID-10 with one disk as a hot spare. If you
don't have a battery backed caching controller, then you'd probably be
better off with two 2 disk RAID-1 arrays and the 5th drive as a hot
spare.

Note that a 4 disk RAID-10 or 2 2 disk RAID-1 with a hot spare is
much more reliable than a 5 disk RAID-5.

> Or should I use 3 disks to build a RAID5, 1 disk for tempspace and 1 disk
> for WAL? How important is data integrity for the WAL? If the WAL disk fails,
> can this corrupt my data? Or would I just lose the data after the last
> checkpoint?

If your data is important, then you will put it on redundant arrays of
independent disks (RAID). WAL is as important as any other part of
the db. It should be on a mirror set at a minimum.

> Or maybe I should use 2 disks as RAID1 for the database, 2 disks as RAID1
> for the WAL and the remaining disk for the tempspace?

That could work too. But I like having a hot spare in case something dies.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Voras 2008-11-05 23:27:46 Re: Are there plans to add data compression feature to postgresql?
Previous Message Sam Mason 2008-11-05 22:26:47 Re: How to use index in WHERE int = float