best RAID configuration for postgres

10,203

Solution 1

Integrated Hardware RAID-0, -1, -1E, optional RAID-5, -6, -10, -50, -60

This sounds a little worrisome to me, it sounds like a low-end RAID controller. You want a good RAID controller that can keep up with 8 fast HDDs (that's actually not a given). If you have a fair amount of writes to your DB, then you really want a Battery Backup Unit, and to enable battery-protected write caching on the RAID controller.

As for RAID disk layout, there are 2 common schools of thought:

  1. 2 disks in mirror for OS, 2 disks in mirror for DB transaction log, 4 disks in RAID 10 for main DB files.
  2. One big RAID 10 array using all disks, and all OS + log + datastore files on this array (see reasoning here, mirrored by BAARF).

I would rather not take sides on the RAID volume design, it tends to become a bit of a fact-light discussion. Ideally you should experiment with different storage layouts and benchmark them for your specific workload. My gut feel is that all disks in RAID10 is faster and more robust over multiple workloads.

One last thing, to make sure that OS partitions and RAID stripe boundaries are aligned (see here, Windows centric, but the principle is general). You can do this when you create the partitions.

Solution 2

Go for the 8x146GB disks in a big RAID10 array (4 mirrored pairs striped together). This should provide you the best speed in terms of IO access.

Solution 3

You should read the information at BAARF the Battle Against Any RAID Five (Four, ...err..., Free). Therefore, the suggestion to go with RAID 10 is good.

And for database performance, use more faster disks (even if they're smaller) rather than fewer slower disks (even if they're bigger).

Share:
10,203

Related videos on Youtube

pstanton
Author by

pstanton

Updated on September 17, 2022

Comments

  • pstanton
    pstanton almost 2 years

    I'm purchasing a server with 8 SAS disks to perform database intensive procedures. Currently the main bottleneck is is large index scans in postgres.

    I'm currently deciding between 8x300Gb 10k disks or 8x140Gb 15k disks as it would be more convenient to have 200Gb+ Logical space.

    The spec sheet for the RAID controller states: "Integrated Hardware RAID-0, -1, -1E, optional RAID-5, -6, -10, -50, -60"

    What would be the best RAID configuration, and what choice in disks would be most suitable?

    I'm new to configuring RAID and postgres and appreciate the advice.

  • pstanton
    pstanton over 14 years
    does that mean with 4 mirrored pairs the logical disk space would be 146x2=292Gb?
  • pstanton
    pstanton over 14 years
    thanks. i'm assuming the 'optional' part is an upgraded unit which we'll probably opt for. does that still sound low end?
  • Frank
    Frank over 14 years
    @pstanton: Yes, it still sounds low-end, because it could be a license key upgrade, not a new RAID controller. But there is no way for me to tell, you'll have to talk to your vendor about the controller performance, and perhaps battery backup capabilities.
  • womble
    womble over 14 years
    No, it would be 146GB*4 since you've got four mirrored pairs of 146GB drives (so 584GB, less HDD manufacturer lie factor, filesystem and LVM overhead, etc).
  • Chopper3
    Chopper3 over 14 years
    I couldn't agree with you more Jesper, this sounds very worrying to me also.
  • Magnus Hagander
    Magnus Hagander over 14 years
    Postgres will always do writes in 8Kb blocks. There is a compile time switch to change it, but usually you don't want to be touching that.
  • pstanton
    pstanton over 14 years
    the upgrade for a RAID 10 controller is an IBM ServeRAID M5015, is that worrying?
  • pstanton
    pstanton over 14 years
    ... and is that better/worse than the HP Smart Array P410 ?