From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Fwd: is there any adverse effect on DB if I set autovacuum scale factor to zero?
Date: Mon, 13 Aug 2018 17:50:10 +0200
Message-ID: <a99783c7-fb14-531b-3177-a2849b6c93f2@2ndquadrant.com> (raw)
In-Reply-To: <CA+C_EDhiY5Qq9XD_FD7_HdXk1oyyXmfiTZ=8Z2HKkLpXF0p75w@mail.gmail.com>
References: <CAEHH7R66M1tqPMveLwq1njcE0A2zvBVUjnUARXCMhF-rQBfuKQ@mail.gmail.com>
<64b01682-49bd-8577-45de-0114fd6af372@2ndquadrant.com>
<CAEHH7R4+9nq4sBRhDZcmdj-qjOabizNv=W8UfAqsXmX2+h51sQ@mail.gmail.com>
<CA+C_EDicKgxzcNjn2qOegts=MWd3Pis1f6HF1317SqzUOq9N8Q@mail.gmail.com>
<CA+C_EDhiY5Qq9XD_FD7_HdXk1oyyXmfiTZ=8Z2HKkLpXF0p75w@mail.gmail.com>
On 08/13/2018 04:24 PM, Ashu Pachauri wrote:
> + pgsql-general
>
> Thanks and Regards,
> Ashu Pachauri
>
>
> ---------- Forwarded message ---------
> From: *Ashu Pachauri* <ashu210890@gmail.com <mailto:ashu210890@gmail.com>>
> Date: Mon, Aug 13, 2018 at 7:53 PM
> Subject: Re: is there any adverse effect on DB if I set autovacuum scale
> factor to zero?
> To: <raghavendrajsv@gmail.com <mailto:raghavendrajsv@gmail.com>>
>
>
> The way I see *autovacuum_vacuum_scale_factor* is not in terms of
> absolute number but as the percentage of any table that can consist of
> updated / deleted tuples to make it eligible for vacuuming. A factor of
> 0.1 ensures that your tables would be eligible for vacuuming if more
> than 10% of the tuples are deleted/updated.
> 1. If you think that 10% is too high for you in terms of storage cost,
> you can decrease the number or set it to zero. But, I would advise to
> increase the value of *autovacuum_vacuum_threshold* to something
> reasonable if you do that, otherwise you pay the CPU cost frequent
> vacuuming across all tables.
> 2. However, if your issue is not the fixed 10% overhead but the lack of
> throughput i.e. you see the number of deleted/updated tuples keeps
> increasing in an unbounded fashion, the right way to deal with it is a)
> Having higher value of *autovacuum_max_workers* b) lower value for
> *autovacuum_naptime*.
>
Increasing autovacuum_max_workers is unlikely to solve the issue with
throughput, because all the workers are throttled together - there's a
limit on the amount of work that can be done per second. Increasing the
number of workers is akin to allowing more cars on a highway, but also
lowering the speed limit.
You need to increase the limit on amount of work, and lowering naptime
is one way to do that.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: tomas.vondra@2ndquadrant.com
Subject: Re: Fwd: is there any adverse effect on DB if I set autovacuum scale factor to zero?
In-Reply-To: <a99783c7-fb14-531b-3177-a2849b6c93f2@2ndquadrant.com>
References: <CAEHH7R66M1tqPMveLwq1njcE0A2zvBVUjnUARXCMhF-rQBfuKQ@mail.gmail.com> <64b01682-49bd-8577-45de-0114fd6af372@2ndquadrant.com> <CAEHH7R4+9nq4sBRhDZcmdj-qjOabizNv=W8UfAqsXmX2+h51sQ@mail.gmail.com> <CA+C_EDicKgxzcNjn2qOegts=MWd3Pis1f6HF1317SqzUOq9N8Q@mail.gmail.com> <CA+C_EDhiY5Qq9XD_FD7_HdXk1oyyXmfiTZ=8Z2HKkLpXF0p75w@mail.gmail.com> <a99783c7-fb14-531b-3177-a2849b6c93f2@2ndquadrant.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