user/dev discussion of public-inbox itself
 help / color / mirror / Atom feed
From: Eric Wong <>
Subject: [PATCH 3/5] index: max out XAPIAN_FLUSH_THRESHOLD if using --batch-size
Date: Fri,  7 Aug 2020 10:52:16 +0000
Message-ID: <> (raw)
In-Reply-To: <>

If XAPIAN_FLUSH_THRESHOLD is unset, Xapian will default to
10000.  That limits the effectiveness of users specifying
extremely large values of --batch-size.

While we're at it, localize the changes to globals since -index
may be eval-ed in tests (and perhaps production code in the
 script/public-inbox-index | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/script/public-inbox-index b/script/public-inbox-index
index 56df5bfe..e2bca16e 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -42,11 +42,16 @@ if (defined $max_size) {
 		die "`publicInbox.indexMaxSize=$max_size' not parsed\n";
-if (my $bs = $opt->{batchsize} // $cfg->{lc('publicInbox.indexBatchSize')}) {
+my $bs = $opt->{batchsize} // $cfg->{lc('publicInbox.indexBatchSize')};
+if (defined $bs) {
 	PublicInbox::Admin::parse_unsigned(\$bs) or
 		die "`publicInbox.indexBatchSize=$bs' not parsed\n";
-	$PublicInbox::SearchIdx::BATCH_BYTES = $bs;
+local $PublicInbox::SearchIdx::BATCH_BYTES = $bs if defined($bs);
+# out-of-the-box builds of Xapian 1.4.x are still limited to 32-bit
+local $ENV{XAPIAN_FLUSH_THRESHOLD} ||= '4294967295' if defined($bs);
 my $s = $opt->{sequentialshard} //

  parent reply	other threads:[~2020-08-07 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 10:52 [PATCH 0/5] more indexing improvements Eric Wong
2020-08-07 10:52 ` [PATCH 1/5] v2writable: fix batch size accounting Eric Wong
2020-08-07 13:13   ` Eric Wong
2020-08-07 10:52 ` [PATCH 2/5] index: --compact respects --sequential-shard Eric Wong
2020-08-07 10:52 ` Eric Wong [this message]
2020-08-07 10:52 ` [PATCH 4/5] searchidx: use Perl truthiness to detect XAPIAN_FLUSH_THRESHOLD Eric Wong
2020-08-07 10:52 ` [PATCH 5/5] index: add built-in --help / -? Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ \
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone