Some random ideas which mizdebsk uses to improve performance of his workflow with mock.
Rebuild your root cache often (at leats once a day)
# rm -rf /var/cache/mock/CONFIG/root_cache $ mock -r CONFIG init
Use lzop for compression instead of pigz
# yum install -y lzop
in mock.cfg add:
config_opts['plugin_conf']['root_cache_opts']['compress_program'] = 'lzop'
Disable "yum update"
If you reinit root cache often enough then you don't need mock to run yum update every time, it's just waste of time. In file /usr/lib/python2.7/site-packages/mockbuild/backend.py find lines:
if self.chrootWasCached: self._yum(('update',), returnOutput=1)
and remove them (or comment out)
Use different "profiles" for building different kind of packages. For example if build Java packages often then have a mock config "maven.cfg" with:
config_opts['chroot_setup_cmd'] = 'install @buildsys-build maven'
and another for ant
config_opts['chroot_setup_cmd'] = 'install @buildsys-build ant'
and another for eclipse:
config_opts['chroot_setup_cmd'] = 'install @buildsys-build maven eclipse-platform'
and so on...
Use squid cache server. Mock by default uses separate yum caches for separate configs. You could use shared yum cache for more than one mock config, but that only causes concurrency problems. Squid cache solves that issue.
Default squid config isn't quite good for this purpose. Use one squid cache for your machine / home / orgamization instead of multiple instances (each per virtual machine etc.)
Don't use mirrorlist in your yum.conf, use baseurl with a single server.
Set debuglevel=2 instead of default debuglevel=1. Not really a speed improvement, but this increases verbosity and lets you know whats the progress and lets you plan your time a bit better, which in turn is a speed improvement :)
Mount /var/lib/mock/CONFIG as tmpfs (or symlink to a subdirectory under /dev/shm)