]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: hashserv: Turn off sqlite synchronous mode
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Jul 2019 13:08:30 +0000 (14:08 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Aug 2019 10:21:31 +0000 (11:21 +0100)
We're seeing performance problems with hashserv running on a normal build
system. The cause seems to be the large amounts of file IO that builds involve
blocking writes to the database. Since sqlite blocks on the sync calls, this
causes a significant problem.

Since if we lose power we have bigger problems, run with synchronous=off
to avoid locking and put the jounral into memory to avoid any write issues
there too.

This took writes from 120s down to negligible in my tests, which means
hashserv then responds promptly to requests.

(Bitbake rev: 7ae56a4d4fcf66e1da1581c70f75e30bfdf3ed83)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/hashserv/__init__.py

index 7ec9b64419c0d2e8ae024d5e09202b992b28c646..544bc86b1649166722d394b86c7428bc0ef53e02 100644 (file)
@@ -21,6 +21,8 @@ class HashEquivalenceServer(BaseHTTPRequestHandler):
     def opendb(self):
         self.db = sqlite3.connect(self.dbname)
         self.db.row_factory = sqlite3.Row
+        self.db.execute("PRAGMA synchronous = OFF;")
+        self.db.execute("PRAGMA journal_mode = MEMORY;")
 
     def do_GET(self):
         try: