All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] prserv: Use WAL mode
@ 2014-11-05 16:58 Richard Purdie
  2014-11-06 13:58 ` Martin Jansa
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2014-11-05 16:58 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
index 3bdc046..9d6d115 100644
--- a/bitbake/lib/prserv/db.py
+++ b/bitbake/lib/prserv/db.py
@@ -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):




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] prserv: Use WAL mode
  2014-11-05 16:58 [PATCH] prserv: Use WAL mode Richard Purdie
@ 2014-11-06 13:58 ` Martin Jansa
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2014-11-06 13:58 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

On Wed, Nov 05, 2014 at 04:58:13PM +0000, Richard Purdie wrote:
> 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?

> change, write overhead appears significantly reduced.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
> index 3bdc046..9d6d115 100644
> --- a/bitbake/lib/prserv/db.py
> +++ b/bitbake/lib/prserv/db.py
> @@ -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):
> 
> 
> -- 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-06 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 16:58 [PATCH] prserv: Use WAL mode Richard Purdie
2014-11-06 13:58 ` Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.