Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0MCJ-0006lI-OO for pgsql-general@arkaria.postgresql.org; Mon, 05 Jul 2021 10:51:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m0MCI-0004e5-OF for pgsql-general@arkaria.postgresql.org; Mon, 05 Jul 2021 10:51:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0MCI-0004dx-D3 for pgsql-general@lists.postgresql.org; Mon, 05 Jul 2021 10:51:30 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0MCG-0002PX-Cc for pgsql-general@lists.postgresql.org; Mon, 05 Jul 2021 10:51:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YbNIt7Iz0kpjeYp2KUstHKe4ABtAcaQC7HK4G80/aR0=; b=cyIqIEPI2Q5OMh6qYekvEMvTbl e5PB0vL4d2COfsJwY7m0oJnIje/Ix/L+3ADSQaf3Aukb9GdZal4Wte/lrjTHWugdw+gBaOq1C+KoO 3Kyy1u0KiVxQbN4dNCQfe8+KsTTBs+9bpsoy/QN89qm6lY5vPJqSGnKC8jvx7JnvxBq8=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1m0MCE-0007k7-UI; Mon, 05 Jul 2021 12:51:26 +0200 Date: Mon, 5 Jul 2021 12:51:26 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Atul Kumar Cc: pgsql-general Subject: Re: number of wal file is not reduced. Message-ID: <20210705105126.GA18337@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 05, 2021 at 03:18:14PM +0530, Atul Kumar wrote: > I have postgres 9.6 running server on centos 7, the number of wal file > in pg_xlog directory is above 4000 so to save some disk space, I > thought of reducing to 100. ... > Please suggest when the number of wal files will be reduced to approx 100. It's hard to say for sure. There are potential issues that might cause pg to keep more wal files than configured. Generally these kinds of things are easier solved in more interactive medium - like IRC, or Slack. But, to give you some start, check if: 1. archiving doesn't fail 2. archiving doesn't lag 3. there are no prepared transactions 4. there are no lagging replication slots Best regards, depesz