summaryrefslogtreecommitdiff
path: root/buildstream/_project.py
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2018-08-08 13:40:54 +0100
committerJavier Jardón <jjardon@gnome.org>2018-08-09 17:31:15 +0100
commit4e1488ee4849894f8476fc1fafcf6911d18b94a7 (patch)
tree052038eeee0a3c4a1c9dc07290e0b1904e7953d8 /buildstream/_project.py
parent2d0611737481825fe20113723a5e6c3a7e0bbc53 (diff)
downloadbuildstream-4e1488ee4849894f8476fc1fafcf6911d18b94a7.tar.gz
buildstream/_project.py: Restrict max-jobs
even if the machine have mores cores available Patch taken from YBD: https://gitlab.com/baserock/ybd/blob/master/ybd/app.py#L227
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r--buildstream/_project.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index ba49f7d73..951662e2b 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -571,7 +571,10 @@ class Project():
# Extend variables with automatic variables and option exports
# Initialize it as a string as all variables are processed as strings.
- output.base_variables['max-jobs'] = str(len(os.sched_getaffinity(0)))
+ # Based on some testing (mainly on AWS), maximum effective
+ # max-jobs value seems to be around 8-10 if we have enough cores
+ # users should set values based on workload and build infrastructure
+ output.base_variables['max-jobs'] = str(min(len(os.sched_getaffinity(0)), 8))
# Export options into variables, if that was requested
output.options.export_variables(output.base_variables)