Re: track_io_timing default setting

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: 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>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: track_io_timing default setting
Date: 2021-12-22 19:57:46
Message-ID: CAH2-WznGS8Tw3w_d-862VffWsRh15HzdTx_aTGg+G2WNwqAfJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 22, 2021 at 11:16 AM Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > I set "track_io_timing" to "on" all the time, same as "log_lock_waits",
> > so I'd want them both on by default.
>
> Same. I'd also push back and ask what modern platforms still require a
> kernel call for gettimeofday, and are we really doing ourselves a favor
> by holding back on enabling this by default due to those?

+1

> If it's such
> an issue, could we figure out a way to have an 'auto' option where we
> detect if the platform has such an issue and disable in that case, but
> enable otherwise?

This is the same principle behind wal_sync_method's per-platform
default, of course. Seems like a similar case to me.

I think that the following heuristic might be a good one: If the
platform uses clock_gettime() (for INSTR_TIME_SET_CURRENT() stuff),
then enable track_io_timing by default on that platform. Otherwise,
disable it by default. (Plus do whatever makes the most sense on
Windows, which uses something else entirely.)

The issue with gettimeofday() seems to be that it isn't really
intended for the same purpose as clock_gettime() -- it's just for
getting the time, not measuring elapsed time. It seems reasonable to
suppose that an operating system that offers a facility for measuring
elapsed time won't have horrible performance problems. clock_gettime()
first appeared in POSIX almost 30 years ago.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-12-22 21:03:08 Re: \d with triggers: more than one row returned by a subquery used as an expression
Previous Message Stephen Frost 2021-12-22 19:16:16 Re: track_io_timing default setting