From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] lei pmdir: fix nproc for <= 4 CPUs
Date: Tue, 8 Jun 2021 23:56:13 +0000 [thread overview]
Message-ID: <20210608235613.15577-1-e@80x24.org> (raw)
I forgot my FreeBSD VM has 8 cores, actually, and tweaked the
nproc detection on that machine before finalizing commit
10b523eb017162240b1ac3647f8dcbbf2be348a7
("lei import: speed up repeated Maildir imports")
Fixes: 10b523eb01716224 ("lei import: speed up repeated Maildir imports")
---
lib/PublicInbox/LeiPmdir.pm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/LeiPmdir.pm b/lib/PublicInbox/LeiPmdir.pm
index 5efb012e..b71efe70 100644
--- a/lib/PublicInbox/LeiPmdir.pm
+++ b/lib/PublicInbox/LeiPmdir.pm
@@ -13,14 +13,14 @@ use parent qw(PublicInbox::IPC);
sub new {
my ($cls, $lei, $ipt) = @_;
my $self = bless { -wq_ident => 'lei Maildir worker' }, $cls;
- my $jobs = $lei->{opt}->{jobs};
+ my $jobs = $lei->{opt}->{jobs} // '';
$jobs =~ /\A[0-9]+,([0-9]+)\z/ and $jobs = $1;
- my $nproc = $jobs // do {
- # untested with >=4 CPUs, though I suspect I/O latency
+ my $nproc = $jobs || do {
+ # barely tested with >=4 CPUs, though I suspect I/O latency
# of SATA SSD storage will make >=4 processes unnecessary,
# here. NVMe users may wish to use '-j'
my $n = $self->detect_nproc;
- $n = 4 if $n > 4;
+ $n = $n > 4 ? 4 : $n;
};
my ($op_c, $ops) = $lei->workers_start($self, $nproc,
undef, { ipt => $ipt }); # LeiInput subclass
reply other threads:[~2021-06-08 23:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210608235613.15577-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).