Re: Calculating average block write time - Mailing list pgsql-general

From Tom Lane
Subject Re: Calculating average block write time
Date
Msg-id 2234521.1668788671@sss.pgh.pa.us
Whole thread Raw
In response to Re: Calculating average block write time  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: copy databases from two differend backups to one cluster
Next
From: Thomas Kellerer
Date:
Subject: Re: Calculating average block write time