Disk arrays, RAID, and disk layout
Many people start their PostgreSQL tuning work by asking about how to spread the various pieces of the database across a large disk array. Recommending how to do that is really application specific, and it's only after covering so much background the last few chapters that the right context is available to even discuss it.
If you have a really large number of disks available, a dozen or more, presuming that disk space needed for the database wasn't a problem a good configuration would look like the following:
Location |
Disks |
RAID Level |
Purpose |
---|---|---|---|
/ (root) |
2 |
1 |
Operating system |
$PGDATA |
6+ |
10 |
Database |
$PGDATA/pg_xlog |
2 |
1 |
WAL |
Tablespace |
1+ |
None |
Temporary files |
Here we're presuming that you want every bit of important data to be redundant, and therefore are using the mirroring facilities of RAID1 to do that. This gives a 3:1 ratio between database read/write throughput and that of the WAL...