SLOPDB / DOCUMENTATION / CONCURRENT WRITES: 96 AND 200 WRITERS

Concurrent writes: 96 and 200 writers

Main results

See the later random UPDATE results for the one-million-transactions/s goal.

Each transaction commits one row change. Rows have 80 logical bytes. WAL is enabled; WAL fsync is disabled in this table. Values are medians of three consecutive 30-second samples after a 10-second warm-up. All samples use the same growing database for that case.

Operation 96 writers, transactions/s 200 writers, transactions/s
INSERT, random keys 239,271 270,261
INSERT, persistent automatic IDs 29,695 21,534
INSERT, restart-reuse automatic IDs 330,265 344,354
UPDATE, random IDs 329,629 405,660
UPDATE, sequential IDs 368,340 439,884

Random inserts slow as the database grows. At 96 writers, the three samples are 251,232, 239,271, 215,472 transactions/s. At 200 writers, they are 297,355, 270,261, 200,883. The random insert CPU use rises while throughput falls. Flushes and compaction are included in timing. These runs do not establish a long-term steady write rate.

The restart-reuse ID samples also fall in the last interval: 334,223 / 330,265 / 285,783 at 96 writers, and 344,354 / 344,648 / 265,288 at 200 writers. The medians must be read with this decline in mind.

Settings and data

Original data: /tmp/slopdb-select-bench-20261014/database-small. Its 145 SSTable names and sizes, and its fixture metadata, are unchanged. INSERT databases and UPDATE copies remain under /tmp/slopdb-write-bench-20261016/.

Reference build

Reference: commit a0769eaa8c6b263f6db482e31f9db74b895d84fb. Both binaries use the same final benchmark code and padded worker counters. The reference build only omits the new option assignment. Each reference case has two 12-second samples after a 3-second warm-up. The new build has longer runs and larger final databases. These values show observed rates at different durations; they are not matched long-term speed ratios.

Operation Reference, 96 writers New, 96 writers Reference, 200 writers New, 200 writers
INSERT, random keys 160,441 239,271 163,715 270,261
INSERT, persistent automatic IDs 8,395 29,695 4,120 21,534
UPDATE, random IDs 193,311 329,629 197,123 405,660
UPDATE, sequential IDs 197,775 368,340 195,078 439,884

WAL fsync enabled: 200 writers

Each case has one 20-second sample after a 3-second warm-up. These shorter controls use WAL fsync on every committed group. Close/reopen checks passed; the test does not simulate a power failure.

Operation Reference transactions/s New transactions/s
INSERT, random keys 92,506 123,818
INSERT, persistent automatic IDs 1,752 19,327
INSERT, restart-reuse automatic IDs — 153,162
UPDATE, random IDs 91,788 133,093
UPDATE, sequential IDs 106,221 155,425

Persistent automatic IDs improve from 1,752 to 19,327 transactions/s in this matched durable control. Counter snapshots enter the WAL queue in order. The catalog publication mutex is released after queue insertion, so other transactions can share the fsync. With fsync disabled, the shorter commit path is faster and remains in use.

CPU, latency, and groups

CPU is the mean number of busy cores during timing. Mean latency uses one sample per 64 successful transactions per writer. The p99 column is the largest histogram-bin upper bound across the three samples; it is not an exact p99. Groups are total timed transactions divided by total timed WAL groups.

Operation Writers Busy cores Mean latency, µs p99 upper bound, µs Transactions/group
INSERT, random keys 96 21.57 407 2,097 40.7
INSERT, random keys 200 28.99 801 16,777 88.2
INSERT, persistent automatic IDs 96 5.13 3,237 33,554 1.0
INSERT, persistent automatic IDs 200 5.68 9,229 67,109 1.0
INSERT, restart-reuse automatic IDs 96 13.66 302 2,097 39.9
INSERT, restart-reuse automatic IDs 200 14.05 626 8,389 56.9
UPDATE, random IDs 96 10.31 293 1,049 46.7
UPDATE, random IDs 200 12.60 496 2,097 98.2
UPDATE, sequential IDs 96 10.47 259 524 46.4
UPDATE, sequential IDs 200 12.38 444 1,049 98.1

All configured writers made progress in every sample. There were no external lock-timeout or conflict retries. Internal lock waits are included in transaction time. Exact per-writer minimum and maximum counts are in the JSON file.

Flushes, compaction, and memory

Flush and compaction counts cover the three timed samples. Compaction output is cumulative output, not live database size. Peak RSS covers the entire process, including setup, warm-up, close, reopen, and verification. Go allocation bytes count all allocations during timing, not retained heap bytes.

Operation Writers Flushes Compactions Compaction output, GiB Peak RSS, GiB Allocated bytes/transaction GC cycles
INSERT, random keys 96 687 5 3.18 3.92 7,194 733
INSERT, random keys 200 747 4 1.90 4.36 7,555 734
INSERT, persistent automatic IDs 96 106 94 1.44 0.37 16,497 945
INSERT, persistent automatic IDs 200 74 71 0.83 0.41 15,662 729
INSERT, restart-reuse automatic IDs 96 924 1456 7.56 3.48 9,848 1388
INSERT, restart-reuse automatic IDs 200 928 1429 7.66 3.53 9,664 1320
UPDATE, random IDs 96 957 39 2.69 8.69 4,831 145
UPDATE, random IDs 200 1174 36 2.49 9.29 4,584 167
UPDATE, sequential IDs 96 1083 39 2.68 6.22 4,730 168
UPDATE, sequential IDs 200 1312 38 2.60 5.97 4,541 194

Changes

Remaining limits

The engine still has one ordered WAL and memtable publication path. Extra writers can join larger groups, but they cannot publish several groups in parallel. At 200 writers, random updates average 98 transactions/group and use about 12.6 cores. Automatic inserts also use a shared ID allocator. Persistent automatic inserts without fsync still serialize counter metadata publication and average one transaction/group.

Earlier, separate profile runs found catalog wait and wake costs in automatic inserts, and catalog lock-manager contention in updates. After the shared catalog path changed, an intermediate 200-writer update profile showed memtable search, Bloom checks, insertion, and scheduler work among the main costs. The old 64-transaction group limit was full. These profiles guided the changes; they are not profiles of the final build and are excluded from the result tables.

Further gains need less work in the serial publication path, fewer SQL row allocations and copies, and less compaction work for growing random-key databases. Parallel publication would need a design that preserves WAL order, transaction atomicity, and reader visibility. Increasing writers alone will not use all 96 cores.

Verification and reproduction

All 27 cases passed verification after close/reopen. INSERT checks every row, all 64 payload bytes, missing or duplicate tickets, and random-key mapping. UPDATE checks all one million target rows, all payload bytes, and that the sum of value changes equals all committed transactions, including warm-up.

The full Go test suite passed. The race test selection passed for catalog publication, generated IDs, WAL queue ordering, lock waits, shutdown, online indexes, and prepared execution. New tests cover 200 concurrent ID writers, default persistent deleted IDs, restart reuse, ID exhaustion, table drop/recreate, inactive table counters, DDL exclusion, and WAL failures.

GOGC=200 GOMAXPROCS=16 go test ./...
GOGC=200 GOMAXPROCS=16 go test -race ./db ./sql ./storage \
  -run 'TestPointCatalog|TestCatalog|Test.*GeneratedIDs|TestAutoIncrement|TestQueued|TestLockWaits|TestConcurrentShutdown|TestOnline|TestPrepared' -count=1

See the benchmark tool for build and single-case commands. Exact final commands, samples, source and binary SHA256 values, and verification results are in write-results.json. The serial matrix runner and raw process records remain under /tmp/slopdb-write-bench-20261016/. Pilot and profile runs are excluded from this JSON and all result tables. SQLite is excluded from this benchmark.

Rendered from the project documentation · e5e2eb2View source on GitHub ↗