Skip to content

Commit a4060c5

Browse files
committed
db.d: set wal_autocheckpoint to 5000
This ensures we don't call fsync as often is a user spams protocol messages that modify the database.
1 parent 7548566 commit a4060c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/db.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ final class Database
114114

115115
query("PRAGMA journal_mode = WAL;");
116116
query("PRAGMA synchronous = NORMAL;");
117+
query("PRAGMA temp_store = MEMORY;");
117118
query("PRAGMA foreign_keys = ON;");
118119
query("PRAGMA secure_delete = ON;");
119120
query("PRAGMA busy_timeout = 5000;"); // 5 seconds
120-
query("PRAGMA temp_store = MEMORY;");
121+
query("PRAGMA page_size = 4096;");
122+
query("PRAGMA wal_autocheckpoint = 5000;");
121123

122124
if (log_db) check_integrity();
123125

0 commit comments

Comments
 (0)