From bff478e546cce23b73e482e9995d56c0d5af1e57 Mon Sep 17 00:00:00 2001 From: Bernhard Suttner Date: Thu, 16 Apr 2026 08:51:58 +0200 Subject: [PATCH] Speed up csv compression on SMP machines The output of pbzip2 is fully compatible with bzip2. pbzip2 is optimized on SMP machines as it splits the input in multiple chunks and uses threads to run on multiple cpu cores to speed up the compression. This change requires to add pbzip2 as a requirements in the RPM spec for foreman-maintain. --- definitions/features/foreman_tasks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/features/foreman_tasks.rb b/definitions/features/foreman_tasks.rb index 9ded68da9..c23ca0485 100644 --- a/definitions/features/foreman_tasks.rb +++ b/definitions/features/foreman_tasks.rb @@ -177,7 +177,7 @@ def export_csv(sql, file_name, state) f.write(csv_output) f.close end - execute("bzip2 #{filepath} -c -9 > #{filepath}.bz2") + execute("pbzip2 #{filepath} -c -9 > #{filepath}.bz2") FileUtils.rm_rf(filepath) end