Re: Postgres auto vacuum - Disable

From: "Karthik Jagadish (kjagadis)" <kjagadis(at)cisco(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "Chandruganth Ayyavoo Selvam (chaayyav)" <chaayyav(at)cisco(dot)com>, "Prasanna Satyanarayanan (prassaty)" <prassaty(at)cisco(dot)com>, "Jaganbabu M (jmunusam)" <jmunusam(at)cisco(dot)com>, "Joel Mariadasan (jomariad)" <jomariad(at)cisco(dot)com>
Subject: Re: Postgres auto vacuum - Disable
Date: 2022-11-07 12:12:14
Message-ID: IA1PR11MB617052DBEC065D85913ABC9BD83C9@IA1PR11MB6170.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for the response.

I have follow-up question where the vacuum process is waiting and not doing it’s job. When we grep on waiting process we see below output. Whenever we see this we notice that the vacuum is not happening and the system is running out of space.

[root(at)zpah0031 ~]# ps -ef | grep 'waiting'
postgres 8833 62646 0 Jul28 ? 00:00:00 postgres: postgres cgms [local] VACUUM waiting
postgres 18437 62646 0 Jul27 ? 00:00:00 postgres: postgres cgms [local] VACUUM waiting

What could be the reason as to why the vacuum is not happening? Is it because some lock is present in the table/db or any other reason?

Regards,
Karthik

From: Dave Page <dpage(at)pgadmin(dot)org>
Date: Monday, 7 November 2022 at 5:17 PM
To: Karthik Jagadish (kjagadis) <kjagadis(at)cisco(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org <pgsql-hackers(at)postgresql(dot)org>, Chandruganth Ayyavoo Selvam (chaayyav) <chaayyav(at)cisco(dot)com>, Prasanna Satyanarayanan (prassaty) <prassaty(at)cisco(dot)com>, Jaganbabu M (jmunusam) <jmunusam(at)cisco(dot)com>, Joel Mariadasan (jomariad) <jomariad(at)cisco(dot)com>
Subject: Re: Postgres auto vacuum - Disable
Hi

On Mon, 7 Nov 2022 at 11:42, Karthik Jagadish (kjagadis) <kjagadis(at)cisco(dot)com<mailto:kjagadis(at)cisco(dot)com>> wrote:
Hi,

We have a NMS application in cisco and using postgres as a database.

We have query related to disabling auto vacuum. We have below configuration in postgres.conf where the autovacuum=on is commented out.

[Shape Description automatically generated]

But when checked in database we notice that it’s showing as on

[Graphical user interface, timeline Description automatically generated]

What would this mean? Does it mean that autovacuum is not disabled? Appreciate a response.

Right. The default is for it to be enabled, so commenting out the option does nothing. You would need to set it explicitly to off.

BUT... you almost certainly don't want to do that. Cases where it should be disabled are *extremely* rare. Make sure you *really* know what you're letting yourself in for by disabling autovacuum, and don't rely on 10+ year old performance tuning advice from random places on the internet, if that's what you're doing.

--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-11-07 12:16:09 Re: pg_upgrade test failure
Previous Message Dave Page 2022-11-07 11:47:09 Re: Postgres auto vacuum - Disable