Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
Date: 2023-03-09 22:54:25
Message-ID: CAAKRu_aiRx9AhDLiHHMXSVz2MODDy7xYbHGYxVwYR4FXAtxkUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 9, 2023 at 5:27 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> > On Fri, Mar 10, 2023 at 11:02 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> The caf626b2c code would only work well on platforms that have
> >> microsecond-based sleep primitives, so it was already not too portable.
>
> > Also, the previous coding was already b0rked, because pg_usleep()
> > rounds up to milliseconds on Windows (with a surprising formula for
> > rounding), and also the whole concept seems to assume things about
> > schedulers that aren't really universally true. If we actually cared
> > about high res times maybe we should be using nanosleep and tracking
> > the drift? And spreading it out a bit. But I don't know.
>
> Yeah, I was wondering about trying to make it a closed-loop control,
> but I think that'd be huge overkill considering what the mechanism is
> trying to accomplish.

Not relevant to fixing this, but I wonder if you could eliminate the
need to specify the cost delay in most cases for autovacuum if you used
feedback from how much vacuuming work was done during the last cycle of
vacuuming to control the delay value internally - a kind of
feedback-adjusted controller.

- Melanie

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2023-03-09 23:02:44 Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken
Previous Message Andrew Dunstan 2023-03-09 22:53:10 Re: buildfarm + meson