MantisBT - Zandronum
View Issue Details
0002844Zandronum[All Projects] Suggestionpublic2016-09-28 03:102018-09-30 21:41
AlexMax 
Torr Samaho 
normalfeatureN/A
closedfixed 
2.1 
3.03.0 
0002844: Enable WAL mode on databases
Apparently, recent versions of SQLite3 have a feature called Write-Ahead Logging which appears to confer significant advantages over the default rollback journaling.

'https://www.sqlite.org/wal.html [^]'

It is significantly faster and allows concurrent reading and writing, which is good - I occasionally get messages from people saying that database system slows down with the amount of data they're putting into it, and this might be able to combat latency.

Enabling it is as simple as sending a PRAGMA to the database in question. It is persistent, but it's probably best to always send the PRAGMA upon opening the file just in case. Since it is persistent across opens, you can technically set any database file to WAL mode simply by opening it with the command line client and setting the pragma that way, but obviously not all server administrators can be expected to know this.

The most significant downside with WAL appears to be that the database cannot be located on a network filesystem. However, SQLite already recommends against being used over NFS, and although I haven't tested it myself, I'm willing to bet that safe use of sqlite over NFS might block the entire server process with additional latency, which would be unacceptable.
No tags attached.
Issue History
2016-09-28 03:10AlexMaxNew Issue
2017-04-08 13:02Torr SamahoNote Added: 0017098
2017-04-08 13:02Torr SamahoStatusnew => needs testing
2017-04-08 13:02Torr SamahoProduct Version => 2.1
2017-04-08 13:02Torr SamahoTarget Version => 3.0
2017-04-08 13:02Torr SamahoAssigned To => Torr Samaho
2017-04-08 13:02Torr SamahoStatusneeds testing => assigned
2017-04-08 13:03Torr SamahoStatusassigned => needs testing
2017-04-08 13:21Edward-sanNote Added: 0017101
2017-04-08 13:31Torr SamahoNote Added: 0017102
2017-04-08 16:42Edward-sanNote View State: 0017101: public
2017-09-07 20:34DuskStatusneeds testing => resolved
2017-09-07 20:34DuskFixed in Version => 3.0
2017-09-07 20:34DuskResolutionopen => fixed
2018-09-30 21:41Blzut3Statusresolved => closed

Notes
(0017098)
Torr Samaho   
2017-04-08 13:02   
The SQLite3 database can now be used in WAL mode. This mode is enabled / disabled with the new CCMDs 'db_enable_wal' / 'db_disable_wal'
(0017101)
Edward-san   
2017-04-08 13:21   
Is it okay for these CCMDs to not be protected against ConsoleCommand?
(0017102)
Torr Samaho   
2017-04-08 13:31   
No, they should be protected. Thanks for pointing this out. Fixed.