Re: Storage location of temporary files

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
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 08:37:42
Message-ID: 49115B56.1070500@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2008-11-05 08:13, Christian Schröder wrote:

> If I have 5 disks available, how should I use them to get best
> performance without the risk of severe data loss?

What percentage of your usage are writes? What do you need the most:
high throughput or minimal latency?

> 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?

It is important. With corrupted WAL IMHO your database will not get up.

> 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?

I'd go for 3 disks as RAID1 for database, OS and tempspace, 2 disks as
RAID1 for WAL. The reasoning is that on a dedicated server OS will
rarely write or read. A commit will only sync WAL, and checkpoints can
be smoothed so they will not cripple reads. Reads by separate clients
will not wait for each other, as they can use 3 disks concurrently, so
read latency will be very good.

If you do not have a disk controller with battery backed cache remember
to disable hardware write cache on all disks
("hdparm -W 0 /dev/sd[a,b,c,d]" for ATA on Linux). And use smartd for
periodic checking health of drives (for example in /etc/smartd.conf for
ATA on Linux):
/dev/sda -H -C -U -l selftest -m root -s (S/../.././01|L/../../7/03)
/dev/sdb -H -C -U -l selftest -m root -s (S/../.././01|L/../../7/03)
/dev/sdc -H -C -U -l selftest -m root -s (S/../.././01|L/../../7/03)
/dev/sdd -H -C -U -l selftest -m root -s (S/../.././01|L/../../7/03)

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2008-11-05 08:40:44 Re: postgresql installation - PL/???
Previous Message Rafal Pietrak 2008-11-05 07:41:27 INSERT .... RETURNING