[projects/pld-ftp-admin] pfa-genindex: build one tree and arch per 2 CPUs by default

arekm arekm at pld-linux.org
Wed Oct 28 12:53:02 CET 2026


commit dee6f8d9e971f88eceff0d3f3656d9da93999c42
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Oct 28 11:13:04 2026 +0100

    pfa-genindex: build one tree and arch per 2 CPUs by default
    
    The default of one job per 12 CPUs, sized for the 12 workers of
    createrepo_c, ran one job at a time on a 6 CPU server.  A job keeps
    about one CPU busy, however: there a full rebuild of three trees took
    455 and 382 s with -j 3, using 2.6 CPUs on average, against 958 and
    734 s with -j 1.  At least 2 jobs, so that one computes while another
    waits for the disk.

 bin/pfa-genindex | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/bin/pfa-genindex b/bin/pfa-genindex
index 9851ed1..6c4814e 100755
--- a/bin/pfa-genindex
+++ b/bin/pfa-genindex
@@ -35,10 +35,10 @@ parser = argparse.ArgumentParser(
     formatter_class=argparse.RawDescriptionHelpFormatter)
 parser.add_argument('-q', '--quiet', action='store_true',
     help='less output; errors are still shown')
-# createrepo_c runs 12 workers, so this keeps them at about one per CPU
+# a job keeps about one CPU busy, however many workers createrepo_c starts
 parser.add_argument('-j', '--jobs', type=jobs_count, metavar='N',
-    default=max(1, len(os.sched_getaffinity(0)) // 12),
-    help='build up to N trees and archs at once (default: %(default)s, one per 12 CPUs)')
+    default=max(2, len(os.sched_getaffinity(0)) // 2),
+    help='build up to N trees and archs at once (default: %(default)s, one per 2 CPUs, at least 2)')
 # --index and the switches share one list, so they apply in command line order
 parser.add_argument('--index', dest='ops', action='append', type=index_list, metavar='LIST',
     help=f"comma separated index types to generate: {', '.join(INDEXES)} (default: {','.join(INDEXES)})")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/dee6f8d9e971f88eceff0d3f3656d9da93999c42



More information about the pld-cvs-commit mailing list