pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lawrence Jones <lawrjone@gmail.com>
To: Ilyeop Yi <ilyeop.yi@samsung.com>
Cc: pgsql-general@postgresql.org
Subject: Re: About "Cost-based Vacuum Delay"
Date: Fri, 15 Jun 2018 13:29:18 +0100
Message-ID: <01B01945-B568-408C-A139-C6281E7E0DBC@gmail.com> (raw)
In-Reply-To: <20180614232929epcas1p1c0a03f435b0504f543933d3680c048e2~4KqbEAa9H3081430814epcas1p1i@epcas1p1.samsung.com>
References: <CGME20180614232929epcas1p1c0a03f435b0504f543933d3680c048e2@epcas1p1.samsung.com>
	<20180614232929epcas1p1c0a03f435b0504f543933d3680c048e2~4KqbEAa9H3081430814epcas1p1i@epcas1p1.samsung.com>

Hey Ilyeop,

> Q1. How can I know/check if the autovacuum is actually paused periodically
> according to autovacuum_vacuum_cost_limit and autovacuum_vacuum_cost_delay?

Vacuums that are triggered by the auto-vacuum process will be governed by the autovacuum cost configuration variables. You won’t find this from your logs, but you could verify this is the case by estimating the disk throughput your autovacuum cost settings would normally provide and compare that to the observed usage of the vacuum processes.

> Q2. Is there any way to manually pause a running vacuum process?

The pause is simply to throttle the resource usage of the vacuum, to prevent negatively impacting other work in the database. It’s far less a feature, more a tool to fairly share system resources. As such, (afaik) there isn’t a way to request that Postgres pause an on-going vacuum.

My question would be why you wish to pause the vacuum? The only reason vacuums should bother you (imo) are if they take a lock that prevents you from performing other maintenance work. If you want to prioritise that maintenance work over your vacuum then my advice is to find the vacuum that holds your lock (select * from pg_locks where granted=‘f’) and cancel it with pg_cancel_backend.

Your vacuum will be restarted by the autovacuum process if the target table still requires it, but only after your competing maintenance operation has been granted its locks.

Thanks,
Lawrence

> On 15 Jun 2018, at 00:29, Ilyeop Yi <ilyeop.yi@samsung.com> wrote:
> 
> Hi Guys,
> 
> I have some questions about "cost-based vacuum delay".
> 
> Q1. How can I know/check if the autovacuum is actually paused periodically
> according to autovacuum_vacuum_cost_limit and autovacuum_vacuum_cost_delay?
> 
> I cannot find such an information from log files.
> 
> Q2. Is there any way to manually pause a running vacuum process?
> 
> If so, is there also any way to manually resume the paused vacuum process?
> 
> 
> Best,
> Ilyeop Yi.
> 
> 





view thread (5+ messages)  latest in thread

Message-ID: <01B01945-B568-408C-A139-C6281E7E0DBC@gmail.com>
Permalink:  ../01B01945-B568-408C-A139-C6281E7E0DBC@gmail.com/
Also on:    postgresql.org/message-id/01B01945-B568-408C-A139-C6281E7E0DBC@gmail.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: lawrjone@gmail.com, ilyeop.yi@samsung.com
  Subject: Re: About "Cost-based Vacuum Delay"
  In-Reply-To: <01B01945-B568-408C-A139-C6281E7E0DBC@gmail.com>
  References: <CGME20180614232929epcas1p1c0a03f435b0504f543933d3680c048e2@epcas1p1.samsung.com> <20180614232929epcas1p1c0a03f435b0504f543933d3680c048e2~4KqbEAa9H3081430814epcas1p1i@epcas1p1.samsung.com> <01B01945-B568-408C-A139-C6281E7E0DBC@gmail.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