Re: Berserk Autovacuum (let's save next Mandrill)
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David Rowley <dgrowleyml@gmail.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Amit Kapila <amit.kapila16@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Darafei Komяpa Praliaskouski <me@komzpa.net>, Andres Freund <andres@anarazel.de>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Banck <mbanck@gmx.net>
Date: 2020-03-12T05:38:11Z
Lists: pgsql-hackers
On Thu, 2020-03-12 at 17:47 +1300, David Rowley wrote: > I'm starting to think that we should set the scale_factor to something > like 0.3 and the threshold to 50. Is anyone strongly against that? Or > Laurenz, are you really set on the 10 million threshold? These values are almost the same as "autovacuum_vacuum_scale_factor" and "autovacuum_vacuum_threshold", so you actually agree with Masahiko with the exception that you want it tunable separately. I don't like the high scale factor. If your insert-only table was last vacuumed when it had 500 million rows, the next autovacuum will freeze 150 million tuples, which is a lot. The impact will be less than that of an anti-wraparound vacuum because it is not as persistent, but if our 150 million tuple autovacuum backs down because it hits a lock or gets killed by the DBA, that is also not good, since it will just come again. And the bigger the vacuum run is, the more likely it is to meet an obstacle. So I think that large insert-only tables should be vacuumed more often than that. If the number of tuples that have to be frozen is small, the vacuum run will be short and is less likely to cause problems. That is why I chose a scale factor of 0 here. But I totally see your point about index-only scans. I think the problem is that this insert-only autovacuum serves two masters: 1. preventing massive anti-wraparound vacuum that severely impacts the system 2. maintaining the visibility map for index-only scans I thought of the first case when I chose the parameter values. I am afraid that we cannot come up with one setting that fits all, so I advocate a setting that targets the first problem, which I think is more important (and was the motivation for this thread). I could add a paragraph to the documentation that tells people how to configure the parameters if they want to use it to get index-only scans. Yours, Laurenz Albe
Commits
-
Further improve stability fix for partition_aggregate test.
- 18d85e9b8a2b 13.0 landed
-
Improve stability fix for partition_aggregate test.
- 7cb0a423f914 13.0 landed
-
Attempt to stabilize partitionwise_aggregate test
- cefb82d49e21 13.0 landed
-
Fix race condition in statext_store().
- fe3036527a1f 13.0 landed
- 6c426cd43790 12.3 landed
-
Attempt to fix unstable regression tests, take 2
- 24566b359d09 13.0 landed
-
Attempt to fix unstable regression tests
- 2dc16efedc76 13.0 landed
-
Trigger autovacuum based on number of INSERTs
- b07642dbcd8d 13.0 landed
-
Fix upper limit for vacuum_cleanup_index_scale_factor
- 4d54543efa5e 11.0 cited