Last change
on this file was
13818,
checked in by westram, 10 years ago
|
- do not use more than 80% of cores
- run at least 2 jobs (on single cores)
|
-
Property svn:executable set to
*
|
File size:
401 bytes
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | # determines cores used by jenkins builds |
---|
4 | my $cores = `cat /proc/cpuinfo | grep processor | wc -l`; # no /proc/cpuinfo (e.g. on OSX) -> falls back to minimum |
---|
5 | if ($cores<1) { $cores = 1; } |
---|
6 | |
---|
7 | my $usedcores = int($cores * 0.8); # reserve some cores for docker etc. |
---|
8 | if ($usedcores<1) { $usedcores = 1; } |
---|
9 | |
---|
10 | my $jobs = ($usedcores < 2) ? 2 : $usedcores; # use at least 2 jobs |
---|
11 | print "$jobs"; |
---|
12 | |
---|
Note: See
TracBrowser
for help on using the repository browser.