Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5R0y-0000X3-3h for pgsql-admin@arkaria.postgresql.org; Fri, 20 Oct 2017 06:42:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e5R0w-0006eu-Oc for pgsql-admin@arkaria.postgresql.org; Fri, 20 Oct 2017 06:42:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e5R0v-0006eJ-0W for pgsql-admin@postgresql.org; Fri, 20 Oct 2017 06:42:37 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e5R0s-0006oi-7F for pgsql-admin@postgresql.org; Fri, 20 Oct 2017 06:42:36 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id BC14A4C8E6; Fri, 20 Oct 2017 08:42:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id 9J9GMyAcS58P; Fri, 20 Oct 2017 08:42:30 +0200 (CEST) Message-ID: <1508481749.2624.4.camel@cybertec.at> Subject: Re: WAL segement issues on both master and slave server From: Laurenz Albe To: Chris Kim , pgsql-admin@postgresql.org Date: Fri, 20 Oct 2017 08:42:29 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Chris Kim wrote: > I am running into an issue with the number of files that reside on the > pg_xlog directory of my compliance database server (This one is the > master server in our master-slave setup). Sometime earlier this year, > I modified the location of the PITR directory and that caused an issue > with WAL segments not being sent to the correct location and crashing > the DB. I went ahead and fixed that up so that it points to the correct > location but since then the number of files on the pg_xlog directory > went up from around 898 to 1025. I didn't have a chance to look in > to this issue until now so my question is do you know if there is > an easy way to clean up some of these files in the pg_xlog directory > safely? I believe that there might be some orphaned files there and > would like to clean those up. You should never remove files manually from pg_xlog. Look at "pg_stat_archiver" to see what's going on with archiving. Is it behind schedule? There are several settings that can cause pg_xlog to grow: - very high wal_keep_segments - very high checkpoint_segments You probably have an old version of PostgreSQL if you didn't touch the configuration in 5 years, but if not, you should also look if there are active replication slots that keep WAL around. > Also, on the Standby, the pg_xlog directory appears like it is growing > on a daily basis. The WAL files are being cleaned up but I don't > believe at a fast enough rate. This directory is approximately > over 650GB in size and I would like to revisit if any of the parameters > will need to be changed in the postgresql.conf file since it's almost > 5 years since I last touched this. Look at the "pg_stat_replication" view in the primary to see how replication is doing. Yours, Laurenz Albe -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin