how to speed up mock

Clark Williams clark.williams at gmail.com
Thu Jun 14 17:18:02 UTC 2012


On Thu, 14 Jun 2012 17:57:01 +0200
Farkas Levente <lfarkas at lfarkas.org> wrote:

> On 06/14/2012 05:34 PM, Paul Howarth wrote:
> > On 06/14/2012 03:26 PM, Farkas Levente wrote:
> >> On 05/30/2012 10:48 AM, Paul Howarth wrote:
> >>> Are you using the tmpfs plugin? That improves things significantly if
> >>> you can spare the RAM. Here's the mock config options I use:
> >>>
> >>> config_opts['plugin_conf']['tmpfs_enable'] = True
> >>> config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb'] = 4096
> >>> config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '2048m'
> >>
> >> could you or someone explain me what does the:
> >> - required_ram_mb
> >
> > The build machine must have at least that much RAM to use the tmpfs plugin.
> >
> >> - max_fs_size
> >
> > Limit for the size of the filesystem used for that instance's chroot. So
> > if your buildroot for a given package exceeds that size, the build will
> > fail. The default is half the system RAM I believe.
> >
> >> means?
> >>
> >> and what these value mean if i run two mock build with different
> >> configuration file? ie the above values are mock global or mock instant
> >> local values?
> >
> > If you have configurations with different 'required_ram_mb' values, one
> > of those will run on a host with less memory than the other.
> >
> > If you have multiple mock instances running together, each one would
> > have its own tmpfs instance and you could end up using as much RAM as
> > the sum of the 'max_fs_size' value for each concurrently-running instance.
> >
> > That's my understanding anyway.
> 
> thanks.
> 
> to translate into to my setup. if i've 24gb ram in the compile machine, than
> - i've to set required_ram_mb=24576 or somewhere around ~24000 (probably 
> in the site-defaults.cfg, since there is no reason to put into the 
> configuration files).
> - and the sum of each concurrent running running mock instance's 
> max_fs_size must be less then required_ram_mb?
> 
>

I believe Paul got it right and I think you summarized correctly. 

The thing to remember is that mock is using the tmpfs filesystem, which
pulls from one pool of memory. You can't add up all the max_fs_size
parameters and have them equal the amount of available memory, because
you'll either swap yourself into the ground or start triggering the OOM
killer (or both). You have to leave some pad of memory available for
Linux and the already running processes.  I don't have any concrete
numbers for you but I'd say that you would want to use no more than
two-thirds or three-quarters of available RAM for your tmpfs'es. 

Clark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/buildsys/attachments/20120614/818a1134/attachment.sig>


More information about the buildsys mailing list