From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 50DEE20083 for ; Mon, 1 Feb 2021 08:28:35 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 16/21] sharedkv: do not set cache_size by default Date: Sun, 31 Jan 2021 22:28:28 -1000 Message-Id: <20210201082833.3293-17-e@80x24.org> In-Reply-To: <20210201082833.3293-1-e@80x24.org> References: <20210201082833.3293-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: These DBs will probably be too small to be worth increasing the cache size of. --- lib/PublicInbox/SharedKV.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(<<'');