Re: track_io_timing default setting

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: track_io_timing default setting
Date: 2021-12-10 16:33:28
Message-ID: 64278e07-c802-3537-bfb2-9a50809ead93@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/10/21 17:22, Laurenz Albe wrote:
> On Fri, 2021-12-10 at 10:20 -0500, Tom Lane wrote:
>> Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
>>> Can we change the default setting of track_io_timing to on?
>>
>> That adds a very significant amount of overhead on some platforms
>> (gettimeofday is not cheap if it requires a kernel call).  And I
>> doubt the claim that the average Postgres user needs this, and
>> doubt even more that they need it on all the time.
>> So I'm -1 on the idea.
>
> I set "track_io_timing" to "on" all the time, same as "log_lock_waits",
> so I'd want them both on by default.
>

IMHO those options have very different overhead - log_lock_waits logs
only stuff that exceeds deadlock_timeout (1s by default), so the amount
of gettimeofday() calls is miniscule compared to calling it for every
I/O request.

I wonder if we could simply do the thing we usually do when measuring
expensive stuff - measure just a small sample. That is, we wouldn't
measure timing for every I/O request, but just a small fraction. For
cases with a lot of I/O requests that should give pretty good image.

That's not a simple "change GUC default" patch, but it's not a very
complicated patch either.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Blake, Geoff 2021-12-10 17:44:36 Add spin_delay() implementation for Arm in s_lock.h
Previous Message Laurenz Albe 2021-12-10 16:22:51 Re: track_io_timing default setting