Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Melanie Plageman <melanieplageman(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-15 04:59:35
Message-ID: CA+hUKGJcOmr1H55DxxvyiNu1qByUTY_A=5sBb7Y7SFfWTgRdRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 15, 2023 at 7:54 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> Here is roughly what I had in mind:
>
> NOTE: Although the delay is specified in microseconds, older Unixen and
> Windows use periodic kernel ticks to wake up, which might increase the
> delay time significantly. We've observed delay increases as large as
> 20 milliseconds on supported platforms.

Sold. And pushed.

I couldn't let that 20ms != 1s/100 problem go, despite my claim that I
would, and now I see: NetBSD does have 10ms resolution, so everyone
can relax, arithmetic still works. It's just that it always or often
adds on one extra tick, for some strange reason. So you can measure
20ms, 30ms, ... but never as low as 10ms. *Shrug*. Your description
covered that nicely.

https://marc.info/?l=netbsd-current-users&m=144832117108168&w=2

> > (The word "interrupt" is a bit overloaded, which doesn't help with
> > this discussion.)
>
> Yeah, I think it would be clearer if "interrupt" was disambiguated.

OK, I rewrote it to avoid that terminology.

On small detail, after reading Tom's 2019 proposal to do this[1]: He
mentioned SUSv2's ENOSYS error. I see that SUSv3 (POSIX.1-2001)
dropped that. Systems that don't have the "timers" option simply
shouldn't define the function, but we already require the "timers"
option for clock_gettime(). And more practically, I know that all our
target systems have it and it works.

Pushed.

[1] https://www.postgresql.org/message-id/4902.1552349020@sss.pgh.pa.us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2023-03-15 05:13:24 Re: Should vacuum process config file reload more often
Previous Message Michael Paquier 2023-03-15 04:57:28 Re: Fix fseek() detection of unseekable files on WIN32