Re: AIO writes vs hint bits vs checksums
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>, Robert Haas <robertmhaas@gmail.com>, Thomas Munro <thomas.munro@gmail.com>
Date: 2024-09-25T02:00:22Z
Lists: pgsql-hackers
On Tue, Sep 24, 2024 at 04:30:25PM -0400, Andres Freund wrote: > On 2024-09-24 12:43:40 -0700, Noah Misch wrote: > > On Tue, Sep 24, 2024 at 11:55:08AM -0400, Andres Freund wrote: > > > Besides that, the need to copy the buffers makes checkpoints with AIO > > > noticeably slower when checksums are enabled - it's not the checksum but the > > > copy that's the biggest source of the slowdown. How big is that copy's contribution to the slowdown there? A measurable CPU overhead on writes likely does outweigh the unmeasurable overhead on index scans, but ... > > > Does this sound like a reasonable idea? Counterpoints? > > How should we think about comparing the distributed cost of the buffer > > header manipulations during index scans vs. the costs of bounce buffers? > > Well, the cost of bounce buffers would be born as long as postgres is up, > whereas a not-measurable (if it indeed isn't) cost during index scans wouldn't > really show up. ... neither BM_SETTING_HINTS nor keeping bounce buffers looks like a bad decision. From what I've heard so far of the performance effects, if it were me, I would keep the bounce buffers. I'd pursue BM_SETTING_HINTS and bounce buffer removal as a distinct project after the main AIO capability. Bounce buffers have an implementation. They aren't harming other design decisions. The AIO project is big, so I'd want to err on the side of not designating other projects as its prerequisites. > Zooming out (a lot) more: I like the idea of having a way to get the > permission to perform some kinds of modifications on a page without an > exlusive lock. While obviously a lot more work, I do think there's some > potential to have some fast-paths that perform work on a page level without > blocking out readers. E.g. some simple cases of insert could correctly be done > without blocking out readers (by ordering the update of the max page offset True.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Require share-exclusive lock to set hint bits and to flush
- 82467f627bd4 19 (unreleased) landed
-
heapam: Move logic to handle HEAP_MOVED into a helper function
- 548de59d93d5 19 (unreleased) landed
-
Add very basic test for kill_prior_tuples
- 377b7ab14524 19 (unreleased) landed
-
aio: Add README.md explaining higher level design
- fdd146a8ef2b 18.0 landed
-
heapam: Only set tuple's block once per page in pagemode
- 2904324a88f6 18.0 landed
-
bufmgr: Use AIO in StartReadBuffers()
- 12ce89fd0708 18.0 landed
-
bufmgr: Implement AIO read support
- 047cba7fa0f8 18.0 landed
-
aio: Implement support for reads in smgr/md/fd
- 50cb7505b301 18.0 landed
-
aio: Add io_method=io_uring
- c325a7633fcb 18.0 landed
-
aio: Add io_method=worker
- 247ce06b883d 18.0 landed
-
aio: Infrastructure for io_method=worker
- 55b454d0e140 18.0 landed
-
aio: Add core asynchronous I/O infrastructure
- da7226993fd4 18.0 landed
-
bufmgr: Make it easier to change number of buffer state bits
- 418451bfe161 18.0 landed