Why does [auto-]vacuum delay not report a wait event? - Mailing list pgsql-hackers

From Andres Freund
Subject Why does [auto-]vacuum delay not report a wait event?
Date
Msg-id 20200319224449.pbjrivflbf4x76tj@alap3.anarazel.de
Whole thread Raw
Responses Re: Why does [auto-]vacuum delay not report a wait event?  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Why does [auto-]vacuum delay not report a wait event?  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
Hi,

I was looking at [1], wanting to suggest a query to monitor what
autovacuum is mostly waiting on. Partially to figure out whether it's
mostly autovacuum cost limiting.

But uh, unfortunately the vacuum delay code just sleeps without setting
a wait event:

void
vacuum_delay_point(void)
{
...
    /* Nap if appropriate */
    if (msec > 0)
    {
        if (msec > VacuumCostDelay * 4)
            msec = VacuumCostDelay * 4;

        pg_usleep((long) (msec * 1000));


Seems like it should instead use a new wait event in the PG_WAIT_TIMEOUT
class?

Given how frequently we run into trouble with [auto]vacuum throttling
being a problem, and there not being any way to monitor that currently,
that seems like it'd be a significant improvement, given the effort?


It'd probably also be helpful to report the total time [auto]vacuum
spent being delayed for vacuum verbose/autovacuum logging, but imo
that'd be a parallel feature to a wait event, not a replacement.


Greetings,

Andres Freund

[1] https://postgr.es/m/CAE39h22zPLrkH17GrkDgAYL3kbjvySYD1io%2BrtnAUFnaJJVS4g%40mail.gmail.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Berserk Autovacuum (let's save next Mandrill)
Next
From: Nikita Glukhov
Date:
Subject: Re: SQL/JSON: functions