Skip to main content
SUNDAY SYSTEMS DIGEST · ONE MEASURED ESSAY EVERY WEEKREAD · BENCHMARK · REFLECTZERO TRACKING PIXELS · FULL RSS & MARKDOWN ARCHIVENEW BENCHMARK: DETERMINISTIC RAFT LEASE QUORUMS
KERN.

Search Archive

Recent & Most Read Essays (8)

Predictable SQLite WAL Checkpoints in Read-Heavy Edge Services

Preventing unbounded `-wal` file growth caused by forgotten long-lived read transactions, plus exact `PRAGMA` settings for multi-gigabyte embedded catalogs.

Henrik Lindqvist
Henrik Lindqvist

Principal Systems Architect · Stockholm

Dec 14, 20257 min read166 words
Predictable SQLite WAL Checkpoints in Read-Heavy Edge Services

SQLite in Write-Ahead Logging (WAL) mode comfortably serves 90,000 concurrent point queries per second per node—right up until a single streaming export coroutine holds an open read snapshot for twenty minutes. While that reader holds its end-mark, RESTART and TRUNCATE checkpoints cannot recycle frames past that mark, ballooning the -wal file from 4 MB to 3.8 GB.

The Dedicated Writer + Bounded Reader Pool Pattern

Never share a single connection pool across reads and writes in SQLite. Open one connection with txlock=immediate exclusively for serialized writes, and a separate read-only pool (?mode=ro) capped to CPU core count with a hard 2,500 ms statement deadline.

sql
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA wal_autocheckpoint = 0; -- Disable surprise inline checkpoints on write commits
PRAGMA mmap_size = 1073741824; -- 1 GiB read-only memory map
PRAGMA busy_timeout = 5000;

Disabling wal_autocheckpoint on the hot write connection and running PRAGMA wal_checkpoint(PASSIVE) on a dedicated background ticker every 1,500 ms moves page-copy work off user-facing HTTP mutations.

When Embedded Beats Networked Caches

Shipping read-mostly catalog snapshots alongside WebAssembly isolates—as detailed in Anatomy of a Sub-Millisecond WebAssembly Component Cold Start—eliminates Redis serialization hops entirely. Just remember that NVMe flush behavior still obeys the physical NAND rules analyzed in Pacing LSM-Tree Compaction Debt on High-Queue NVMe Drives.

Connected Architecture Notes

Henrik Lindqvist

Henrik Lindqvist

Stockholm · UTC+1

Principal distributed systems architect writing weekly benchmarks on consensus protocols, storage engines, WebAssembly isolates, and tactile web accessibility.

Reader Field Notes

0 verified notes

No published field notes yet on this essay. Share a production observation or benchmark note below.

Contribute a Technical Note

Moderated manually for signal-to-noise. Your email is never stored in public comment properties.

Enter your display name.
Enter a valid email or leave blank.
Please write at least 8 characters.
Please confirm publication consent.

Continue Reading

All essays →

Get next Sunday’s benchmark by email

Full essay in plain HTML, zero tracking pixels, one-click unsubscribe.

Enter a valid email address (for example, name@domain.com).