Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWjL1-0004hQ-Mh for pgsql-general@arkaria.postgresql.org; Tue, 11 Dec 2018 14:48:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gWjL0-0005qi-DA for pgsql-general@arkaria.postgresql.org; Tue, 11 Dec 2018 14:48:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWjKz-0005lh-W0 for pgsql-general@lists.postgresql.org; Tue, 11 Dec 2018 14:48:42 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWjKv-0001mq-Rc for pgsql-general@lists.postgresql.org; Tue, 11 Dec 2018 14:48:40 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id wBBEmSfT015787 for ; Tue, 11 Dec 2018 16:48:33 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id wBBEmS8P057439 for ; Tue, 11 Dec 2018 16:48:28 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: finding out what's generating WALs To: pgsql-general@lists.postgresql.org References: <86ae8f52-f0f3-2e74-c763-1af2553247e1@withers.org> From: Achilleas Mantzios Message-ID: <5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com> Date: Tue, 11 Dec 2018 16:48:28 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <86ae8f52-f0f3-2e74-c763-1af2553247e1@withers.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-29.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/12/18 4:00 μ.μ., Chris Withers wrote: > Hi All, > > With a 9.4 cluster, what's the best way to find out what's generating the most WAL? > > I'm looking after a multi-tenant PG 9.4 cluster, and we've started getting alerts for the number of WALs on the server. > It'd be great to understand what's generating all that WAL and what's likely to be causing any problems.\ > One way is to keep snapshots of pg_stat_user_tables and then try to identify spikes based on the various _tup fields. Another way is to take a look in your archive (where you keep your archived wals), try to identify a period where excessive wals were generated and then use https://www.postgresql.org/docs/11/pgwaldump.html to see what's in there. > More generally, what's number of WALs is "too much"? check_postgres.pl when used in nagios format only appears to be able to alert on absolute thresholds, does this always make sense? What's a good > threshold to alert on? > Regarding you wals in pg_wal,  a good threshold could be anything more than a e.g. 10% increase from wal_keep_segments with a trend to go up. If this number goes up chances are something bad is happening. > cheers, > > Chris > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt