Re: Track the amount of time waiting due to cost_delay

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Track the amount of time waiting due to cost_delay
Date: 2024-06-11 18:47:29
Message-ID: ZmibwXuVL1iVH7pJ@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 11, 2024 at 06:19:23PM +0000, Imseih (AWS), Sami wrote:
>> I'm not convinced that reporting the number of waits is useful. If we
>> were going to report a possibly-inaccurate amount of actual waiting,
>> then also reporting the number of waits might make it easier to figure
>> out when the possibly-inaccurate number was in fact inaccurate. But I
>> think it's way better to report an accurate amount of actual waiting,
>> and then I'm not sure what we gain by also reporting the number of
>> waits.
>
> I think including the number of times vacuum went into sleep
> will help paint a full picture of the effect of tuning the vacuum_cost_delay
> and vacuum_cost_limit for the user, even if we are reporting accurate
> amounts of actual sleeping.
>
> This is particularly true for autovacuum in which the cost limit is spread
> across all autovacuum workers, and knowing how many times autovacuum
> went to sleep will be useful along with the total time spent sleeping.

I'm struggling to think of a scenario in which the number of waits would be
useful, assuming you already know the amount of time spent waiting. Even
if the number of waits is huge, it doesn't tell you much else AFAICT. I'd
be much more likely to adjust the cost settings based on the percentage of
time spent sleeping.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-06-11 18:48:30 Re: Track the amount of time waiting due to cost_delay
Previous Message Imseih (AWS), Sami 2024-06-11 18:19:23 Re: Track the amount of time waiting due to cost_delay