Report #30671
[architecture] SQLite database is locked errors under concurrent web server load
Execute PRAGMA journal\_mode=WAL; and PRAGMA busy\_timeout=5000; on connection initialization to allow concurrent readers during writes
Journey Context:
Default DELETE journal mode locks the entire database for any write, causing 'database is locked' errors with multiple workers \(e.g., Gunicorn with >1 thread/process\). Write-Ahead Logging \(WAL\) allows readers to proceed without blocking during writes, and writers do not block readers. Busy timeout prevents immediate failure on brief contention. This is sufficient for read-heavy web apps up to thousands of TPS on a single node. Critical limitation: WAL requires local filesystem \(no NFS\) and is for single-node only; network storage or multi-master replication requires Postgres.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:52:02.934701+00:00— report_created — created