Moving pg_xlog

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Perform" <pgsql-performance(at)postgresql(dot)org>
Subject: Moving pg_xlog
Date: 2005-06-01 15:31:13
Message-ID: 20050601151618.M48325@narrowpathinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi All,

I have been reading about increasing PostgreSQL performance by relocating the
pg_xlog to a disk other than the one where the database resides. I have the
following pg_xlogs on my system.

/raid02/databases/pg_xlog
/raid02/rhdb_databases/pg_xlog
/raid02/databases-8.0.0/pg_xlog
/var/lib/pgsql/data/pg_xlog

The second and third entries are from backups that were made before major
upgrades so I am expecting that I can blow them away.

The first entry is in the directory where my databases are located.

I have no idea why the forth entry is there. It is in the PostgreSQL
installation directory.

Here is my filesystem.
# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 9052552 2605292 5987404 31% /
/dev/sda1 101089 32688 63182 35% /boot
none 1282880 0 1282880 0% /dev/shm
/dev/sdb2 16516084 32836 15644256 1% /raid01
/dev/sdb3 16516084 1156160 14520932 8% /raid02
/dev/sda5 2063504 32916 1925768 2% /tmp
/dev/sda3 4127108 203136 3714324 6% /var
/dev/cdrom 494126 494126 0 100% /mnt/cdrom

Can I

1) stop the postmaster
2) rm -rf /var/lib/pgsql/data/pg_xlog
3) mv /raid02/databases/pg_xlog /var/lib/pgsql/data/pg_xlog
4) ln -s /var/lib/pgsql/data/pg_xlog /raid02/databases/pg_xlog
5) start postmaster

If I can do that and place the pg_xlog in the installation directory will I
create any installation issues the next time I upgrade PostgreSQL?

TIA

Kind Regards,
Keith

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-06-01 16:19:40 Re: Moving pg_xlog
Previous Message Tom Lane 2005-06-01 14:39:59 Re: How to avoid database bloat