ArmSoM
← All stories

Why the SQLite WAL File Keeps Growing on an Embedded Gateway

A small database on an ArmSoM gateway can be accompanied by an unexpectedly large WAL file. In write-ahead logging mode, checkpoint progress can be limited by active readers. A dashboard that holds a transaction open while it redraws can affect storage consumption.

ArmSoM Sige5 single-board computer product photo

ArmSoM Sige5 single-board computer · ArmSoM

Find the reader that stays open

On a copy of the application data, observe database, WAL and free-space sizes over a representative write cycle. Compare normal operation with a long-running report active. Inspect transaction lifetimes and the application’s checkpoint policy. Closing a report and observing subsequent checkpoints is more informative than deleting files alongside a live database.

Check whether the WAL is still growing or whether a large file is being reused. An unchanged large file after a successful checkpoint can have a different cause from a file that grows on every cycle.

Break excessively long read transactions into appropriate units or change how the reporting snapshot is obtained. Test concurrent readers and writers afterward. Use SQLite’s supported backup facilities when creating a consistent copy for investigation.

Reference material

ArmSoM Sige5 hardware documentation

SQLite write-ahead logging and checkpoint behavior

SQLite online backup interface

Related ArmSoM guide

Building a small arm home server services memory and backups

Explore ArmSoM Sige5