[oe-commits] [bitbake] 03/05: persist_data: Enable Write Ahead Log

git at git.openembedded.org git at git.openembedded.org
Sat Aug 11 10:08:32 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 77e4c6911b923075ca2ca7193e5bcf947c98f690
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Thu Aug 9 17:08:28 2018 -0500

    persist_data: Enable Write Ahead Log
    
    Enabling the write ahead log improves database reliability, speeds up
    writes (since they mostly happen sequentially), and speeds up readers
    (since they are no longer blocked by most write operations). The
    persistent database is very read heavy, so the auto-checkpoint size is
    reduced from the default (usually 1000) to 100 so that reads remain
    fast.
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/persist_data.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index 2bc3e76..9a4e7dd 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -278,7 +278,12 @@ class PersistData(object):
 
 def connect(database):
     connection = sqlite3.connect(database, timeout=5)
-    connection.execute("pragma synchronous = off;")
+    connection.execute("pragma synchronous = normal;")
+    # Enable WAL and keep the autocheckpoint length small (the default is
+    # usually 1000). Persistent caches are usually read-mostly, so keeping
+    # this short will keep readers running quickly
+    connection.execute("pragma journal_mode = WAL;")
+    connection.execute("pragma wal_autocheckpoint = 100;")
     connection.text_factory = str
     return connection
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list