aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-12-03 21:42:32 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-07 12:38:19 +0000
commit79100fa67539f9654af9bf6d3e6842eb5c12e989 (patch)
tree18324e0d5ba986925b7a23eb300257ca5fe8a651 /lib
parentf5ba7775cfcb90401522d977cc66fe0f5aeb7a66 (diff)
downloadbitbake-79100fa67539f9654af9bf6d3e6842eb5c12e989.tar.gz
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. [YOCTO #13030] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/persist_data.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index 2bc3e766a..149279209 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -279,6 +279,11 @@ class PersistData(object):
def connect(database):
connection = sqlite3.connect(database, timeout=5)
connection.execute("pragma synchronous = off;")
+ # 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