From 3b2ac278bbc42cb031999544becb489a8538813d Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Fri, 4 Nov 2016 16:55:55 -0400 Subject: [PATCH] Updating sqlite3 processor to set journal_mode=wal to try to improve performance of concurrent reads (ie, bdsm-web) --- etc/bdsm/processors/sqlite3.processor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/bdsm/processors/sqlite3.processor b/etc/bdsm/processors/sqlite3.processor index 2b55f8d..557e241 100755 --- a/etc/bdsm/processors/sqlite3.processor +++ b/etc/bdsm/processors/sqlite3.processor @@ -41,6 +41,11 @@ help() start() { + journal_mode="`sqlite3 $CONFIG_PATH/bdsm.db 'PRAGMA journal_mode;'`" + if [ "$journal_mode" != "wal" ]; then + sqlite3 $CONFIG_PATH/bdsm.db "PRAGMA journal_mode;" + fi + sqlite3 $CONFIG_PATH/bdsm.db "SELECT 1 FROM MEASUREMENTS" 2>/dev/null 1>&2 if [ $? -eq 1 ]; then sqlite3 $CONFIG_PATH/bdsm.db \ @@ -67,7 +72,7 @@ stop() status() { - running=`cat /home/bdsm/.processor.pid 2>/dev/null | \ + running=`cat /home/bdsm/pids/sqlite3.processor.pid 2>/dev/null | \ xargs ps -T | \ grep -v PID | \ wc -l` -- 1.8.3.1