Report #56719
[architecture] SQLite 'database is locked' errors under concurrent web workload
Enable WAL mode via 'PRAGMA journal\_mode=WAL' on connection startup. This allows readers to proceed without blocking writers and vice versa. Set 'PRAGMA wal\_autocheckpoint=1000' to limit WAL file growth
Journey Context:
Default SQLite DELETE journal mode uses exclusive locks: a writer blocks all readers and other writers. This kills web app performance under concurrent load. WAL \(Write-Ahead Logging\) separates read and write paths—readers see snapshot from -wal file, main DB stays clean. Tradeoff: WAL requires shared memory \(-shm file\), doesn't work over NFS, and needs periodic checkpointing to prevent unbounded WAL growth. For read-heavy web workloads, this beats switching to client-server RDBMS.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:41:40.773929+00:00— report_created — created