~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The journal's one lock holds every append: 39 thousand commits a second with no sync, and half the benchmark's own journal at 256 writers

Open
Open chadtmiller.com opened this issue 0 comments

With PDS_SYNC together every frame is appended to one journal under one lock (crates/pds-store/src/journal.rs, put: the record made, written, room made, the logs touched noted). The store benchmark, the runner:

the server's journalbeside it
commits a second, none synced, 16 writers39 thousand199 thousand with a log for each account and no journal
commits a second, each synced, 256 writers over 2000 accounts821114563 for this benchmark's own journal (which copies no frame under a lock and keeps no pool); RocksDB 7969

While a sync of the disk is what a commit waits for, the lock is not the limit up to 64 writers (7090 a second, RocksDB 3004). At 256 writers a sync covers 105 commits where the benchmark's covers 124, and takes 19 ms where its takes 7.5.

Where to look

  • The record is encoded into a buffer, and written, under the lock: a writer could reserve its place (an offset and a number) under the lock and write outside it, as the benchmark's Placed log does.
  • Room is written under the lock, as much as the segment holds, up to 16 MiB at once.
  • What a sync of the journal waits for beside its own bytes: the checkpoint's syncfs on Linux, due every 1024 logs written, runs beside it.