Book Image

PostgreSQL 9 High Availability Cookbook

By : Shaun Thomas
Book Image

PostgreSQL 9 High Availability Cookbook

By: Shaun Thomas

Overview of this book

Table of Contents (17 chapters)
PostgreSQL 9 High Availability Cookbook
About the Author
About the Reviewers

Tweaking XFS performance

When it comes to performance optimization on XFS filesystems, allocation groups are only the beginning. To maintain a high-availability PostgreSQL server, we want to get the most out of XFS. For us, this means using specific mount options.

Thankfully, unlike formatting, mount options can be changed frequently and require very little downtime. Though it isn't essential that we apply these values immediately, the options discussed in this recipe are our recommendation for this stack.

Getting ready

In order to mount an XFS filesystem, we need one to exist. Please follow the recipe contained in Formatting an XFS Filesystem before continuing.

How to do it...

Assuming pg1 is our current primary node, follow these steps as the root user:

  1. Use this command to find the Linux kernel version:

    uname -r
  2. For kernel versions 3.0 and above, mount the filesystem with this command:

    mount -t xfs -o noatime,nodiratime \-o logbsize=256k,allocsize=1m \/dev/VG_POSTGRES/LV_DATA /db
  3. For kernels...