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

OS

$PGDATA

6+

10

Database

$PGDATA/pg_wal

2

1

WAL

$PGDATA/pg_wal

2

1

WAL

Tablespace

1+

None

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.