From: Brian Flowers Date: Fri, 4 Nov 2016 20:55:55 +0000 (-0400) Subject: Updating sqlite3 processor to set journal_mode=wal to try to improve performance... X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=3b2ac278bbc42cb031999544becb489a8538813d;p=bdsm.git Updating sqlite3 processor to set journal_mode=wal to try to improve performance of concurrent reads (ie, bdsm-web) --- 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`