Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#23075 closed task (fixed)

Add an option to select the number of cores used for building in tor-browser-build.git

Reported by: boklm Owned by: boklm
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-rbm
Cc: tbb-team Actual Points:
Parent ID: #17379 Points:
Reviewer: Sponsor:

Description

Currently the number of cores used for building is hardcoded to 4. We should add an option to select the number of cores used, and maybe use the number of cores in /proc/cpuinfo as the default.

Child Tickets

Change History (6)

comment:1 Changed 2 years ago by boklm

Keywords: tbb-rbm added; tbb-gitian removed

comment:2 Changed 2 years ago by gk

I feel not maxing out the machine for building by default is okay. So, assuming 4 cores might be not unreasonable. It's just that having an env variable to adjust the defaults would be neat.

The same should be doable for memory consumption. Not sure how that is handled in rbm atm but having something like VM_MEMORY there as well sounds like a good idea.

comment:3 in reply to:  2 Changed 2 years ago by boklm

Replying to gk:

The same should be doable for memory consumption. Not sure how that is handled in rbm atm but having something like VM_MEMORY there as well sounds like a good idea.

As we are using containers and not VMs, the memory is shared between the host and the containers. This is also the case in gitian when building with LXC, where VM_MEMORY is ignored in that case.

If we want it we should be able to add an option to set the limit of memory usage for the container:
https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#memory
But given that the memory is shared with the host and there is no memory assigned to the container only, I'm not sure it is useful.

comment:4 Changed 2 years ago by gk

Good point, let's ignore that one (VM_MEMORY) then.

Last edited 2 years ago by gk (previous) (diff)

comment:5 Changed 2 years ago by boklm

Resolution: fixed
Status: newclosed

This is done with commit 60ba86636df928e97e265417b2c19bea4e85ea3a.

It is possible to set the RBM_NB_PROCS environment variable to change the number of processes used. It is also possible to change it by defining buildconf/nb_procs in rbm.local.conf.

comment:6 Changed 2 years ago by boklm

In commit b466ec4bcf9e534652dd98e0f401309e79a93447 I renamed RBM_NB_PROCS to RBM_NUM_PROCS and buildconf/nb_procs to buildconf/num_procs as it seems num_ is more clear than nb_.

Note: See TracTickets for help on using tickets.