From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 51CE61F461 for ; Wed, 24 Apr 2024 01:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1713922893; bh=MbA2lGS6puONsoGogiUg4vy8uPj2BVHHa5gzEXy7nbQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=1PW50JRW2XMy44KxVk9QP1haETm6/v5bpWzS8e7GhJbkfjW5nYloKKNDeOZO4BF5k dMt2PkiFa0Q5zpVlFb7LKj42oiIg45dnkOIftNgnC/iHyey6LyWEygddBks+NteAu5 NZtJoY196YqWnQtmnQbxf+z7aFvzvRdIlxuZALLQ= From: Eric Wong To: spew@80x24.org Subject: [PATCH 2/5] xap_helper.h: remove _SC_NPROCESSORS_ONLN default Date: Wed, 24 Apr 2024 01:41:29 +0000 Message-ID: <20240424014132.476488-2-e@80x24.org> In-Reply-To: <20240424014132.476488-1-e@80x24.org> References: <20240424014132.476488-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's never straightforward what number of processes is ideal for the Xapian helper processes since there may be a massive disparities in CPU count and I/O performance. So default to a single worker for now in the C++ version since that's the default is for the Perl/(XS|SWIG) version as well as our normal public-facing daemons. This keeps the behavior between the Perl+(XS|SWIG) and C++ version as similar as possible. --- lib/PublicInbox/xap_helper.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h index 3456910b..0e6805b3 100644 --- a/lib/PublicInbox/xap_helper.h +++ b/lib/PublicInbox/xap_helper.h @@ -945,12 +945,6 @@ int main(int argc, char *argv[]) } nworker = 1; -#ifdef _SC_NPROCESSORS_ONLN - long j = sysconf(_SC_NPROCESSORS_ONLN); - if (j > 0) - nworker = j > WORKER_MAX ? WORKER_MAX : j; -#endif // _SC_NPROCESSORS_ONLN - // make warn/warnx/err multi-process friendly: if (my_setlinebuf(stderr)) err(EXIT_FAILURE, "setlinebuf(stderr)");