RE: Configure autovacuum

From: "Shenavai, Manuel" <manuel(dot)shenavai(at)sap(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: RE: Configure autovacuum
Date: 2024-07-04 15:16:15
Message-ID: AM9PR02MB7410BBF4916E9720CBB6BA06E8DE2@AM9PR02MB7410.eurprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We see that our DB keeps increasing under high load (many updates). We see that our DB has a size of 200GB and we got 199GB bloat, 0 dead tuple. And when the DB is put on high load (many updates), we still see that the DB size grows. We try to find parameters to avoid DB growth.

I think we need to tweak the autovacuum settings and maybe limit the volume of data that can be written to the DB.

Is there any setting in postgres that would allow to write only certain volume? For example, limit the amount of data that can be written to a table to 100MB/minute.

Best regards,
Manuel

-----Original Message-----
From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Sent: 14 June 2024 16:32
To: Shenavai, Manuel <manuel(dot)shenavai(at)sap(dot)com>; pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Configure autovacuum

On 6/13/24 23:20, Shenavai, Manuel wrote:
> Hi everyone,
>
> I would like to configure the autovacuum in a way that it runs very
> frequently (i.e. after each update-statement). I tried the following

Why?

What is the problem you are trying to solve?

> settings on my table:
>
> alter table mytable set (autovacuum_vacuum_scale_factor  = 0.0);
>
> alter table mytable set (autovacuum_vacuum_cost_delay  = 0.0);
>
> alter table mytable set (autovacuum_vacuum_cost_limit  = 10000);
>
> alter table mytable set (autovacuum_vacuum_threshold  = 1);
>
> I do a lot of updates on a single tuple and I would expect that the
> autovacuum would start basically after each update (due to
> autovacuum_vacuum_threshold=1). But the autovacuum is not running.
>
> Is it possible to configure postgres to autovacuum very aggressively
> (i.e. after each update-statement)?
>
> Thanks in advance &
>
> Best regards,
>
> Manuel
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-07-04 15:42:50 Re: Configure autovacuum
Previous Message Christophe Pettus 2024-07-03 20:25:55 Re: Description field for tables and views