Skip to contentSkip to conversation

prserv: Use WAL mode

PATCH In review Richard Purdie 2 participants 2 messages Nov 5, 2014 – Nov 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prserv: Use WAL mode

Ideally, we want the PR service to have minimal influence from queued disk IO. sqlite tends to be paranoid about data loss and locks/fsync calls. There is a "WAL mode" which changes the journalling mechanism and would appear much better suited to our use case.

This patch therefore switches the database to what WAL mode. With this change, write overhead appears significantly reduced.

bitbake/lib/prserv/db.py +1 -0
index 3bdc046..9d6d115 100644
@@ -235,6 +235,7 @@ class PRData(object):
         self.connection=sqlite3.connect(self.filename, isolation_level="EXCLUSIVE", check_same_thread = False)
         self.connection.row_factory=sqlite3.Row
         self.connection.execute("pragma synchronous = off;")
+        self.connection.execute("PRAGMA journal_mode = WAL;")
         self._tables={}
 
     def __del__(self):
#1 lore raw
Quoted 6 lines · Richard Purdie

Ideally, we want the PR service to have minimal influence from queued disk IO. sqlite tends to be paranoid about data loss and locks/fsync calls. There is a "WAL mode" which changes the journalling mechanism and would appear much better suited to our use case.

This patch therefore switches the database to what WAL mode. With this

^ what = that?

Quoted 23 lines

change, write overhead appears significantly reduced.

bitbake/lib/prserv/db.py +1 -0
index 3bdc046..9d6d115 100644
@@ -235,6 +235,7 @@ class PRData(object):
         self.connection=sqlite3.connect(self.filename, isolation_level="EXCLUSIVE", check_same_thread = False)
         self.connection.row_factory=sqlite3.Row
         self.connection.execute("pragma synchronous = off;")
+        self.connection.execute("PRAGMA journal_mode = WAL;")
         self._tables={}
 
     def __del__(self):
Signature · 5 lines
-- 
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]