about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index f7a318e5..dfcb4897 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -35,14 +35,13 @@ my $PACKING_FACTOR = 0.4;
 our $NPROC_MAX_DEFAULT = 4;
 
 sub detect_nproc () {
-        for my $nproc (qw(nproc gnproc)) { # GNU coreutils nproc
-                `$nproc 2>/dev/null` =~ /^(\d+)$/ and return $1;
-        }
-
         # getconf(1) is POSIX, but *NPROCESSORS* vars are not
         for (qw(_NPROCESSORS_ONLN NPROCESSORS_ONLN)) {
                 `getconf $_ 2>/dev/null` =~ /^(\d+)$/ and return $1;
         }
+        for my $nproc (qw(nproc gnproc)) { # GNU coreutils nproc
+                `$nproc 2>/dev/null` =~ /^(\d+)$/ and return $1;
+        }
 
         # should we bother with `sysctl hw.ncpu`?  Those only give
         # us total processor count, not online processor count.