Field Notes

Occasional write-ups on Linux internals, SQLite tuning, and small static tools.

WAL Mode Checkpoints Under Steady Write Load

Nov 2026 · 4 min read

When running SQLite in WAL mode on a single-node service, long-lived read transactions can prevent the checkpoint thread from reclaiming frames. Setting an explicit busy_timeout and keeping read snapshots short avoids unbounded WAL growth.

PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA wal_autocheckpoint = 1000;

For read-heavy workloads, memory-mapping the first 128 MB via mmap_size noticeably reduces syscall overhead on sequential scans without changing durability guarantees.

Measuring Disk Queue Depth Without Perturbing Production

Oct 2026 · 3 min read

Sampling /proc/diskstats at one-second intervals gives a reliable picture of average request latency (await) and queue saturation without attaching eBPF probes on older kernels.

Keep raw counters alongside monotonic timestamps so counter wraps or device resets can be filtered cleanly during post-processing.

Notes on Reproducible Tar Archives

Sep 2026 · 2 min read

Deterministic build artifacts simplify cache invalidation in CI. Sorting file paths, normalizing ownership to 0:0, and clamping modification times with --mtime guarantees identical SHA-256 digests across hosts.