X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 699925287E for ; Wed, 1 Jun 2005 17:31:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16693-01 for ; Wed, 1 Jun 2005 20:30:54 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2D40A52843 for ; Wed, 1 Jun 2005 17:30:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j51KUsco018211; Wed, 1 Jun 2005 16:30:54 -0400 (EDT) To: KeithW@narrowpathinc.com Cc: "PostgreSQL Perform" Subject: Re: Moving pg_xlog In-reply-to: <20050601200610.M12354@narrowpathinc.com> References: <20050601151618.M48325@narrowpathinc.com> <14825.1117642780@sss.pgh.pa.us> <20050601200610.M12354@narrowpathinc.com> Comments: In-reply-to "Keith Worthington" message dated "Wed, 01 Jun 2005 16:11:43 -0400" Date: Wed, 01 Jun 2005 16:30:54 -0400 Message-ID: <18210.1117657854@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/19 X-Sequence-Number: 12657 "Keith Worthington" writes: > On Wed, 01 Jun 2005 12:19:40 -0400, Tom Lane wrote >> Put the xlog anywhere BUT there!!!!!!!!! > Is there a convention that most people follow. It would seem that > anywhere in the installation directory is a bad idea. From what I > have read on other threads it does not want to be in the database > directory since in most cases that would put it on the same disk as > the database. I don't know of any fixed convention. The way I would be inclined to do it, given that I wanted the data on disk 1 (with mount point /disk1) and xlog on disk 2 (with mount point /disk2) is to create postgres-owned directories /disk1/postgres/ and /disk2/postgres/, and then within those put the data directory (thus, /disk1/postgres/data/) and xlog directory (/disk2/postgres/pg_xlog/). Having an extra level of postgres-owned directory is handy since it makes it easier to do database admin work without being root --- once you've created those two directories and chown'd them to postgres, everything else can be done as the postgres user. Now that I think about it, you were (if I understood your layout correctly) proposing to put the xlog on your system's root disk. This is probably a bad idea for performance, because there will always be other traffic to the root disk. What you are really trying to accomplish is to make sure the xlog is on a disk spindle that has no other traffic besides xlog, so that the disk heads never have to move off the current xlog file. The xlog traffic is 100% sequential writes and so you can cut the seeks involved to near nil if you can dedicate a spindle to it. > I am assuming due to lack of reaction that the symbolic link is not an issue. > Is there a cleaner or more appropriate way of moving the pg_xlog. No, that's exactly the way to do it. > Finally, am I correct in assuming that as long as the postmaster is shut down > moving the log is safe? Right. You can move the data directory too if you want. AFAIR the only position-dependent stuff in there is (if you are using tablespaces in 8.0) the tablespace symlinks under data/pg_tblspc/. You can fix those by hand if you have a need to move a tablespace. regards, tom lane