diff options
author | Eric Wong <e@yhbt.net> | 2020-05-17 19:37:21 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-05-18 02:38:03 +0000 |
commit | c43813b9138398ed2de06c3616a5932725090ae3 (patch) | |
tree | 7c64bf483be47ecf6fa54759670458b1d272fb72 /script/public-inbox-index | |
parent | f3482d4a19a8de47199fa18beb258deb699bf703 (diff) | |
download | public-inbox-c43813b9138398ed2de06c3616a5932725090ae3.tar.gz |
On powerful systems, having this option is preferable to XAPIAN_FLUSH_THRESHOLD due to lock granularity and contention with other processes (-learn, -mda, -watch). Setting XAPIAN_FLUSH_THRESHOLD can cause -learn, -mda, and -watch to get stuck until an epoch is completely processed.
Diffstat (limited to 'script/public-inbox-index')
-rwxr-xr-x | script/public-inbox-index | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index index 2d0f0eca..0018668e 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -16,7 +16,7 @@ use PublicInbox::Xapcmd; my $compact_opt; my $opt = { quiet => -1, compact => 0, maxsize => undef }; GetOptions($opt, qw(verbose|v+ reindex compact|c+ jobs|j=i prune - indexlevel|L=s maxsize|max-size=s)) + indexlevel|L=s maxsize|max-size=s batchsize|batch-size=s)) or die "bad command-line args\n$usage"; die "--jobs must be positive\n" if defined $opt->{jobs} && $opt->{jobs} <= 0; @@ -30,13 +30,20 @@ my $cfg = PublicInbox::Config->new; my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV, undef, $cfg); PublicInbox::Admin::require_or_die('-index'); unless (@ibxs) { print STDERR "Usage: $usage\n"; exit 1 } -my $mods = {}; + my $max_size = $opt->{maxsize} // $cfg->{lc('publicInbox.indexMaxSize')}; if (defined $max_size) { PublicInbox::Admin::parse_unsigned(\$max_size) or die "`publicInbox.indexMaxSize=$max_size' not parsed\n"; } +if (my $bs = $opt->{batchsize} // $cfg->{lc('publicInbox.indexBatchSize')}) { + PublicInbox::Admin::parse_unsigned(\$bs) or + die "`publicInbox.indexBatchSize=$bs' not parsed\n"; + $PublicInbox::SearchIdx::BATCH_BYTES = $bs; +} + +my $mods = {}; foreach my $ibx (@ibxs) { # XXX: users can shoot themselves in the foot, with opt->{indexlevel} $ibx->{indexlevel} //= $opt->{indexlevel} // |