About open source, education and random other Stuff
Speeding up mock
I found this quite useful since I’ve been doing some more mock builds lately:
This will speed up mock builds on your multi-core system. Basically mock uses tar and gzip to create a cache of the buildroot contents before building so that it doesn’t need to install a fresh buildroot every time you do a mock build. Unfortunately gzip can only use one core of your multi-core processor at a time. pigz is a mutli-threaded implementation of gzip that is fully compatible. You can tell mock to use pgiz instead of gzip.
As root do:
- yum install pigz
- open /etc/mock/site-defaults.cfg in your favorite editor
- find the line
# config_opts['plugin_conf']['root_cache_opts']['compress_program'] = “gzip”
In my cfg is is at lines 65. - Uncomment that line and edit it to say pigz instead of gzip
- You’re all set.
| Print article | This entry was posted by Felix Kaechele on March 4, 2010 at 8:58 am, and is filed under Fedora Planet, Linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 4 months ago
The single thing you can do to speed up mock the most is to enable the tmpfs plugin (build on RAM disk).
config_opts['plugin_conf']['tmpfs_enable'] = True
config_opts['plugin_conf']['tmpfs_opts'] = {‘required_ram_mb’: 2048}
You’ll probably get away with 1024 MB for most builds but I use 2048 as I have a lot of RAM on my builder.
I was over the moon when I found out how much this speeded up builds on my system.