From: Eric Wong Date: Mon, 1 Feb 2021 08:28:28 +0000 (-1000) Subject: sharedkv: do not set cache_size by default X-Git-Tag: v1.7.0~1253 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=781a1c891dbd1853e35047a4052af0829f4bda50;p=public-inbox.git sharedkv: do not set cache_size by default These DBs will probably be too small to be worth increasing the cache size of. --- diff --git a/lib/PublicInbox/SharedKV.pm b/lib/PublicInbox/SharedKV.pm index b0588060..d65c3158 100644 --- a/lib/PublicInbox/SharedKV.pm +++ b/lib/PublicInbox/SharedKV.pm @@ -27,7 +27,9 @@ sub dbh { }); my $opt = $self->{opt} // {}; $dbh->do('PRAGMA synchronous = OFF') if !$opt->{fsync}; - $dbh->do('PRAGMA cache_size = '.($opt->{cache_size} || 80000)); + if (my $s = $opt->{cache_size}) { + $dbh->do("PRAGMA cache_size = $s"); + } $dbh->do('PRAGMA journal_mode = '. ($opt->{journal_mode} // 'WAL')); $dbh->do(<<'');