diff options
author | Christopher Baines <mail@cbaines.net> | 2021-12-30 22:30:18 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-12-30 22:30:29 +0000 |
commit | 2ff82fcef4c07b7b847c678ac9ff296a66b7d29f (patch) | |
tree | 6c479caca6c17d835b78f428587279a4e417102b /guix-build-coordinator/datastore | |
parent | dce619ed3bc6bf051885ff1ef0ac35090a12f704 (diff) | |
download | build-coordinator-2ff82fcef4c07b7b847c678ac9ff296a66b7d29f.tar build-coordinator-2ff82fcef4c07b7b847c678ac9ff296a66b7d29f.tar.gz |
Make some SQLite configuration tweaks
I think these help to improve performance, no concrete data through.
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index e64b6c4..f97a164 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -129,7 +129,9 @@ (lambda () (let ((db (db-open database-file #:write? #f))) + (sqlite-exec db "PRAGMA temp_store = MEMORY;") (sqlite-exec db "PRAGMA busy_timeout = 5000;") + (sqlite-exec db "PRAGMA cache_size = -16000;") (list db))) #:destructor (let ((reader-thread-destructor-counter @@ -171,6 +173,8 @@ (let ((db (db-open database-file))) (sqlite-exec db "PRAGMA busy_timeout = 5000;") + (sqlite-exec db "PRAGMA synchronous = NORMAL;") + (sqlite-exec db "PRAGMA temp_store = MEMORY;") (sqlite-exec db "PRAGMA foreign_keys = ON;") (list db))) #:destructor @@ -2910,10 +2914,12 @@ WHERE build_results.build_id = :build_id" (define* (db-open database #:key (write? #t)) (define flags - (list (if write? - SQLITE_OPEN_READWRITE - SQLITE_OPEN_READONLY) - SQLITE_OPEN_NOMUTEX)) + (append + (if write? + (list SQLITE_OPEN_READWRITE) + (list SQLITE_OPEN_READONLY + SQLITE_OPEN_SHAREDCACHE)) + (list SQLITE_OPEN_NOMUTEX))) (unless (file-exists? database) (run-sqitch database)) |