nodejs / build-containers

Docker images used to test pull requests from untrusted sources
29 stars 11 forks source link

Use half of cores available on machine. #17

Closed retrohacker closed 9 years ago

retrohacker commented 9 years ago

Ceiling function for integer division

rvagg commented 9 years ago

fine by me, after you merge, trigger a docker hub rebuild, and wait for it to complete do this:

  1. put the config entries into .ssh/config listed here: https://github.com/iojs/build/tree/master/setup/containers#readme
  2. run this:
ssh ssh iojs-build-containers-1 docker pull -a iojs/build
ssh ssh iojs-build-containers-2 docker pull -a iojs/build

at the moment I think I'm favouring manual updates rather than setting up a hook for docker hub because it'll mean changing docker hub each time we privision new hosts and updating hopefully won't be a frequent exercise.

retrohacker commented 9 years ago

double ssh intentional?

rvagg commented 9 years ago

2 servers

retrohacker commented 9 years ago

Ah, I mean double on the same line: ssh ssh iojs-build...

rvagg commented 9 years ago

hah, no, not sure what that's about, just one will do

bnoordhuis commented 9 years ago

The assumption is that make is GNU make, right? And the intention of this PR is to not consume all cores in case there is more than one build running? Wouldn't it be better in that case to use -l <loadavg> instead of -j <jobs>? Something like make -l $(getconf _NPROCESSORS_ONLN) allows for burst-y behavior when the machine is otherwise unoccupied.

rvagg commented 9 years ago

@bnoordhuis I'd defer to you on the wisdom of this, I generally consider loadavg akin to voodoo but if you think this is a better approach then perhaps we should give it a go

bnoordhuis commented 9 years ago

I've had good results with it. The rule of thumb I use is that the requested load average should not be more than the number of processors. It's okay if those processors are hyperthreaded because compilation is normally memory bandwidth-constrained enough that it doesn't matter.