pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Justin King <kingpin867@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PG12 autovac issues
Date: Thu, 19 Mar 2020 15:35:20 -0700
Message-ID: <20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de> (raw)
In-Reply-To: <CAE39h23RTX1jkYjWc5tccv34HwwraizaCUxOmdQdPM+Zt5-2Qg@mail.gmail.com>
References: <CAE39h22zPLrkH17GrkDgAYL3kbjvySYD1io+rtnAUFnaJJVS4g@mail.gmail.com>
	<20200318011952.caitfhlslpq6zype@alap3.anarazel.de>
	<CAE39h23Rny679=Z3eBQLXTrxHun4N3LLKrFj5o_4YGTSbcJyMQ@mail.gmail.com>
	<CAE39h23RTX1jkYjWc5tccv34HwwraizaCUxOmdQdPM+Zt5-2Qg@mail.gmail.com>

Hi,

On 2020-03-19 10:23:48 -0500, Justin King wrote:
> > From a single stats snapshot we can't actually understand the actual xid
> > consumption - is it actually the xid usage that triggers the vacuums?
> 
> We have looked at this and the xid consumption averages around 1250
> xid/sec -- this is when we see the "aggressive" autovac kick off in
> the logs.  What I don't understand is why these xid's are being
> consumed at this rate on the databases with no activity (postgres,
> template1).

The xid counter is global across all databases.


> > What makes you think it is a problem that you have all these vacuums? If
> > you actually update that much, and you have indexes, you're going want a
> > lot of vacuums?

> I actually don't think there's a problem with the vacuums (I was
> mostly pointing out that they are very regular and not problematic).
> The main problem I am having is that something is causing the
> autovacuums to completely stop and require manual intervention to
> resume -- and it seems to be when the "postgres" or "template1"
> database hits the autovacuum_freeze_max_age.

Did you look at pg_stat_activity for those autovacuums to see whether
they're blocked on something?


> > > What is interesting is that this happens with the 'postgres' and
> > > 'template1' databases as well and there is absolutely no activity in
> > > those databases.
> >
> > That's normal. They should be pretty darn quick in v12?
> 
> Yes, a manual VACUUM FREEZE of either database takes less than 1
> second -- which is why it's perplexing that the autovac starts and
> never seems to complete and prevents other autovacs from running.

One big difference between a manual VACUUM and autovacuum is that with
the default settings VACUUM is not throttled, but autovacuum is.

What are your vacuum_cost_delay, autovacuum_vacuum_cost_delay,
vacuum_cost_limit, autovacuum_vacuum_cost_limit, vacuum_cost_page_hit,
vacuum_cost_page_miss set to?

Greetings,

Andres Freund





view thread (44+ messages)  latest in thread

Message-ID: <20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de>
Permalink:  ../20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de

 · 

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-admin@postgresql.org
  Cc: andres@anarazel.de, kingpin867@gmail.com, pgsql-general@lists.postgresql.org
  Subject: Re: PG12 autovac issues
  In-Reply-To: <20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de>
  References: <CAE39h22zPLrkH17GrkDgAYL3kbjvySYD1io+rtnAUFnaJJVS4g@mail.gmail.com> <20200318011952.caitfhlslpq6zype@alap3.anarazel.de> <CAE39h23Rny679=Z3eBQLXTrxHun4N3LLKrFj5o_4YGTSbcJyMQ@mail.gmail.com> <CAE39h23RTX1jkYjWc5tccv34HwwraizaCUxOmdQdPM+Zt5-2Qg@mail.gmail.com> <20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de>

* 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