[bug/sqlite] sqlite.db-wal
file grows indefinitely without flushing to sqlite.db
#2808
Labels
bug
Something isn't working
Someone's reported this in the Matrix already too, but didn't open an issue for it yet. Opening it now since I can see the problem on my server as well:
^^ Here there's a db size of 7.1G, which is fine for an old and widely federating instance, but a wal file of 1.7G, which is much, much larger than it ought to be. This won't cause any immediate problems on this particular server, but it is likely to cause slowdown over time since reading from the wal file is less optimized than reading from the db itself.
The SQLite docs contain some details on why this situation might occur: https://www.sqlite.org/wal.html#avoiding_excessively_large_wal_files
The one that jumps out at me is checkpoint starvation, particularly:
We should see if we can figure out why this is happening; are we leaving readers open maybe? Or is there some change in the latest version of SQLite that we're using which disables the automatic checkpoint mechanism, or leaves too many readers open, or something?
We could also try enabling manual periodic checkpointing (once per 30 minutes or so), and see if this helps, though I feel like that might just mask some other underlying problem.
The text was updated successfully, but these errors were encountered: