pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Calculating average block write time
Date: Fri, 18 Nov 2022 11:24:31 -0500
Message-ID: <2234521.1668788671@sss.pgh.pa.us> (raw)
In-Reply-To: <7d88dffa-b1ca-062f-8ff4-806f6c3a5578@gmail.com>
References: <90374fa3-d750-e1ab-2fad-eaa7142f6b5a@gmx.net>
	<b68058f6-02d3-52ad-e997-9f42f7443a72@gmx.net>
	<075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at>
	<7d88dffa-b1ca-062f-8ff4-806f6c3a5578@gmail.com>

Ron <ronljohnsonjr@gmail.com> writes:
> On 11/18/22 09:51, Laurenz Albe wrote:
>> On Fri, 2022-11-18 at 11:11 +0100, Thomas Kellerer wrote:
>>> Any ideas on how to get the equivalent of (blk_read_time / blks_read) for blk_write_time?

>> You cannot get that, because most writes are done by the checkpointer, and
>> that does not distinguish between databases.

> For a similar reason to why WAL files can't be be "single database" without 
> significant rewrite?

Right, because we define a checkpoint as cluster-wide.

Another problem with trying to measure this is that we can only know
how long it took to shove the block out to kernel space.  It's highly
unlikely that the physical write has happened by the time write()
returns, and we don't know (nor care that much) exactly when it does
happen.  So it's not clear that the measurement would have much
real-world significance if we did calculate it.

You could argue that read() is also squishy since it might be satisfied
from kernel buffers rather than actually getting bits off the disk.
However, there is some physical reality there: before read() we did
not have the data, and afterwards we do.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <2234521.1668788671@sss.pgh.pa.us>
Permalink:  ../2234521.1668788671@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2234521.1668788671@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com
  Subject: Re: Calculating average block write time
  In-Reply-To: <2234521.1668788671@sss.pgh.pa.us>
  References: <90374fa3-d750-e1ab-2fad-eaa7142f6b5a@gmx.net> <b68058f6-02d3-52ad-e997-9f42f7443a72@gmx.net> <075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at> <7d88dffa-b1ca-062f-8ff4-806f6c3a5578@gmail.com> <2234521.1668788671@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox