about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-20T14·01+0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-20T14·01+0000
commit1906cce6fcea88d07b55c0b9734da39675e17a4d (patch)
treed092bcb7135af43bbca3413cd227cc3580f5d916 /src/libstore
parent9b11165aec8639b021527978603423826b6b9cc3 (diff)
Increase SQLite's auto-checkpoint interval
Common operations like instantiating a NixOS system config no longer
fitted in 8192 pages, leading to more fsyncs.  So increase this limit.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/local-store.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index ab5ab70d07..29095e1eaa 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -380,10 +380,10 @@ void LocalStore::openDB(bool create)
         sqlite3_exec(db, ("pragma main.journal_mode = " + mode + ";").c_str(), 0, 0, 0) != SQLITE_OK)
         throwSQLiteError(db, "setting journal mode");
 
-    /* Increase the auto-checkpoint interval to 8192 pages.  This
+    /* Increase the auto-checkpoint interval to 40000 pages.  This
        seems enough to ensure that instantiating the NixOS system
        derivation is done in a single fsync(). */
-    if (mode == "wal" && sqlite3_exec(db, "pragma wal_autocheckpoint = 8192;", 0, 0, 0) != SQLITE_OK)
+    if (mode == "wal" && sqlite3_exec(db, "pragma wal_autocheckpoint = 40000;", 0, 0, 0) != SQLITE_OK)
         throwSQLiteError(db, "setting autocheckpoint interval");
 
     /* Initialise the database schema, if necessary. */