pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Autovacuum degrades all other operations by keeping all buffers dirty?
4+ messages / 3 participants
[nested] [flat]

* Autovacuum degrades all other operations by keeping all buffers dirty?
@ 2018-08-31 21:53  David Pacheco <dap@joyent.com>
  0 siblings, 1 reply; 4+ messages in thread

From: David Pacheco @ 2018-08-31 21:53 UTC (permalink / raw)
  To: pgsql-general

Hello,

We've been struggling with some major performance issues related to
autovacuum.
(I know this is a common problem.)  For a while, we believed this was
primarily
related to I/O contention, but recent observations from our monitoring make
me
wonder if there's a deeper issue here, so I'm looking for some better
understanding.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Autovacuum degrades all other operations by keeping all buffers dirty?
@ 2018-08-31 22:31  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: David Pacheco <dap@joyent.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Alvaro Herrera @ 2018-08-31 22:31 UTC (permalink / raw)
  To: David Pacheco <dap@joyent.com>; +Cc: pgsql-general

On 2018-Aug-31, David Pacheco wrote:

> From reading the 9.6.3 source, it looks like the autovacuum process
> itself is single-threaded, and it reads pages essentially linearly
> from the relation (possibly skipping some).  When the autovacuum
> process needs to modify a page, it doesn't write it directly, but
> rather marks the buffer dirty.  The page will be written later,

Unless there's some bug, there is a BufferAccessStrategy that only lets
a few dozen buffers go unwritten before the autovac worker process
itself is forced to write some.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Autovacuum degrades all other operations by keeping all buffers dirty?
@ 2018-08-31 22:50  Andres Freund <andres@anarazel.de>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Andres Freund @ 2018-08-31 22:50 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: David Pacheco <dap@joyent.com>; pgsql-general

On 2018-08-31 19:31:47 -0300, Alvaro Herrera wrote:
> On 2018-Aug-31, David Pacheco wrote:
> 
> > From reading the 9.6.3 source, it looks like the autovacuum process
> > itself is single-threaded, and it reads pages essentially linearly
> > from the relation (possibly skipping some).  When the autovacuum
> > process needs to modify a page, it doesn't write it directly, but
> > rather marks the buffer dirty.  The page will be written later,
> 
> Unless there's some bug, there is a BufferAccessStrategy that only lets
> a few dozen buffers go unwritten before the autovac worker process
> itself is forced to write some.

I've not re-checked, but I'm not sure that's true if the buffer is
already in s_b, which it'll be for many workloads.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Autovacuum degrades all other operations by keeping all buffers dirty?
@ 2018-09-05 18:06  David Pacheco <dap@joyent.com>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 4+ messages in thread

From: David Pacheco @ 2018-09-05 18:06 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-general

On Fri, Aug 31, 2018 at 3:50 PM, Andres Freund <andres@anarazel.de> wrote:

> On 2018-08-31 19:31:47 -0300, Alvaro Herrera wrote:
> > On 2018-Aug-31, David Pacheco wrote:
> >
> > > From reading the 9.6.3 source, it looks like the autovacuum process
> > > itself is single-threaded, and it reads pages essentially linearly
> > > from the relation (possibly skipping some).  When the autovacuum
> > > process needs to modify a page, it doesn't write it directly, but
> > > rather marks the buffer dirty.  The page will be written later,
> >
> > Unless there's some bug, there is a BufferAccessStrategy that only lets
> > a few dozen buffers go unwritten before the autovac worker process
> > itself is forced to write some.
>
> I've not re-checked, but I'm not sure that's true if the buffer is
> already in s_b, which it'll be for many workloads.
>


Does that mean this analysis from above is accurate?

It looks to me like the autovacuum process is effectively generating work
> (in
> the form of async writes) that's being distributed implicitly to the
> various
> backend processes, creating latency for any other query that happens to
> require
> a buffer (including read-only queries).


Thanks,
Dave

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-09-05 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 21:53 Autovacuum degrades all other operations by keeping all buffers dirty? David Pacheco <dap@joyent.com>
2018-08-31 22:31 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2018-08-31 22:50   ` Andres Freund <andres@anarazel.de>
2018-09-05 18:06     ` David Pacheco <dap@joyent.com>

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