poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
963 stars 121 forks source link

Prefer WAL mode for OLM sqlite store? #200

Open nwf opened 4 years ago

nwf commented 4 years ago

0bd20cc3336985c158e1a19f0c78fe9e42590160 introduced a sqlite database for OLM key storage. On a test machine, this database was getting updated every minute or so, resulting in creation and removal of a -journal file for sqlite's ACID-ity. This means a largeish burst of filesystem-induced synchronous block-device traffic, which resulted in perceptible lag from within weechat (my machine's backing block devices are not particularly fast and might even be better considered quite slow at random writes like this).

In any case, using the sqlite3 CLI application and asserting pragma journal_mode=WAL; has resulted in a much better state of affairs. Is there reason not to make it the default?

poljar commented 4 years ago

There is no specific reason, I agree that WAL mode should be turned on. Though that database code lives in matrix-nio nowadays.