PostgreSQL 9.0 High Performance
上QQ阅读APP看书,第一时间看更新

Chapter 4. Disk Setup

Most operating systems include multiple options for the filesystem used to store information onto the disk. Choosing between these options can be difficult, because it normally involves some tricky speed vs. reliability trade-offs. Similarly, how to set up your database to spread its components across many available disks also has trade-offs, with speed, reliability, and available disk space all linked. PostgreSQL has some facilities to split its database information over multiple disks, but the optimal way to do that is very much application dependent.

Maximum filesystem sizes

One of the topics discussed for each filesystem is how large of a volume can you put on it. For most of them, that number is 16 TB, a shared artifact of using 32 bit numbers to represent filesystem information. Right now, it's quite easy to exceed 16 TB in a volume created with a moderately sized array of terabyte or larger hard drives. This makes this number an increasingly problematic limit.

There are three levels of issues you can run into here:

  1. The data structures of the filesystem itself don't support large volumes.
  2. Tools used to create and manipulate the filesystem do not handle large sizes.
  3. The disk partitioning scheme needed to boot the operating system doesn't handle large volumes.

The last of those is worth spending a moment on, since that problem is mostly independent of the filesystem specific details of the first two.

Most PC hardware on the market, with the notable exception of Apple Intel Mac OS X systems, partition drives using the Master Boot Record (MBR) partitioning scheme. This only supports partition sizes up to 2 TB in size. Creating a larger partition that you can boot from, will require a different partitioning scheme. One possibility is the GUID Partition Table (GPT) scheme, promoted by Intel as a part of their Extensible Firmware Interface (EFI) standard intended to replace the old PC BIOS booting methods. Apple is so far the main early adopter of EFI and GPT. See http://en.wikipedia.org/wiki/GUID_Partition_Table for more information about GPT partitions, their support in various operating systems, and the backward compatibility possibilities available.

This area is not very well explored or supported yet. Proceed with caution if you expect to need greater than 2TB volumes on the PC hardware, even if your chosen filesystem obviously supports it. At a minimum, expect that you may need to have a smaller operating system disk that you boot off, only using GPT partitioning on the data disks mounted after the OS has started.