Skip to content
Snippets Groups Projects
Unverified Commit 65e3624b authored by Mathieu Othacehe's avatar Mathieu Othacehe
Browse files

Optimize SQLite database.

* src/cuirass/database.scm (set-db-options): Optimize database parameters.
parent b67f38a7
No related branches found
No related tags found
No related merge requests found
......@@ -256,6 +256,17 @@ dedicated to writing. EXP evaluation is queued unless #:force? is set."
;;(sqlite-busy-timeout db (* 30 1000))
(sqlite-exec db "PRAGMA busy_timeout = 30000;")
;; The want to prioritize read operations over write operations as we can
;; have a large number of clients, while the number of write operations is
;; modest. Use a small WAL journal to do that, and try to reduce disk I/O
;; by increasing RAM usage as described here:
;; https://wiki.mozilla.org/Performance/Avoid_SQLite_In_Your_Next_Firefox_Feature
(sqlite-exec db "PRAGMA wal_autocheckpoint = 16;")
(sqlite-exec db "PRAGMA journal_size_limit = 1536;")
(sqlite-exec db "PRAGMA page_size = 32768;")
(sqlite-exec db "PRAGMA cache_size = -500000;")
(sqlite-exec db "PRAGMA temp_store = MEMORY;")
(sqlite-exec db "PRAGMA synchronous = NORMAL;")
db)
(define (db-load db schema)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment