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

The service checkpoint is written whole at each compaction

Open
Open chadtmiller.com opened this issue 0 comments

The service checkpoint is one sorted table (crates/pds-server/src/compact.rs), and the service log is compacted once it is 8 MiB (store.rs, SERVICE_CAP), so that a start replays no more than that. Each compaction writes the table whole.

What it costs

The scale run's 100000 accounts make a table of 124 MiB, about 1.3 KB an account as the harness makes them: 500000 accounts would be about 650 MiB written, and read, for every 8 MiB of service log, which is some 6000 accounts made or some 20000 sessions refreshed. A row no log touched is copied unparsed, so it is disk and time, not memory: but it is time and disk that grow with the accounts for a fixed amount of new data.

What would fix it

A second level: small tables of what recent logs changed, merged into the large one rarely, with lookups reading both. spec/STORE.md's settled bound (three times the live state) leaves room for it.

What would check it

The store benchmark's service part (bench/store/service.mjs) timing a compaction after a few writes on a table of 100000 and 500000 accounts: today it times only the first compaction, of a log holding every account.