Re: Vacuum Tuning Question

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Murthy Nunna <mnunna(at)fnal(dot)gov>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Vacuum Tuning Question
Date: 2023-05-19 20:36:23
Message-ID: d5dce67447f184745c3d53da7f6b9e203ac41726.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2023-05-19 at 15:35 +0000, Murthy Nunna wrote:
> Following are the settings I have. I am wondering if there is a way autovacuum  can keep the above
> “datfrozenxid” low and not keep increasing. Thank you ahead time for reading my post.
>  
> postgres=# select name, setting, unit from pg_settings where name like '%autovacuum%';
>                  name                  |  setting   | unit
> ---------------------------------------+------------+------
> autovacuum                            | on         |
> autovacuum_analyze_scale_factor       | 0.1        |
> autovacuum_analyze_threshold          | 5000       |
> autovacuum_freeze_max_age             | 1500000000 |
> autovacuum_max_workers                | 5          |
> autovacuum_multixact_freeze_max_age   | 400000000  |
> autovacuum_naptime                    | 60         | s
> autovacuum_vacuum_cost_delay          | 2          | ms
> autovacuum_vacuum_cost_limit          | -1         |
> autovacuum_vacuum_insert_scale_factor | 0          |
> autovacuum_vacuum_insert_threshold    | 5000       |
> autovacuum_vacuum_scale_factor        | 0          |
> autovacuum_vacuum_threshold           | 5000       |
> autovacuum_work_mem                   | -1         | kB
> log_autovacuum_min_duration           | 0          | ms
> (15 rows)

There is no need to keep "age(datfrozenxid)" low, but if you want to do that, the correct way
is to reduce "autovacuum_multixact_freeze_max_age".

Your settings are pretty crazy. You won't succeed in anything but having autovacuum run
all the time. You should reset the thresholds and scale_factors to the default values.

To make autovacuum more aggressive (if that is indeed necessary), reduce
"autovacuum_vacuum_cost_delay". I wouldn't do that globally, but only on the tables that
receive lots of updates and deletes.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Janes 2023-05-20 00:50:56 Re: Vacuum Tuning Question
Previous Message Binh Le 2023-05-19 18:30:44 Re: Vacuum Tuning Question