pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: finding out what's generating WALs
Date: Tue, 11 Dec 2018 16:48:28 +0200
Message-ID: <5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com> (raw)
In-Reply-To: <86ae8f52-f0f3-2e74-c763-1af2553247e1@withers.org>
References: <86ae8f52-f0f3-2e74-c763-1af2553247e1@withers.org>

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





view thread (2+ messages)

Message-ID: <5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com>
Permalink:  ../5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: finding out what's generating WALs
  In-Reply-To: <5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com>
  References: <86ae8f52-f0f3-2e74-c763-1af2553247e1@withers.org> <5ee4505c-2227-74e9-3d98-32e34f10bf20@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox