summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2019-05-06 15:38:00 -0400
committerMathew Robinson <chasinglogic@gmail.com>2019-05-13 10:44:50 -0400
commit3f3e8de9eaf73169b627fc2a8054ee6537a1795c (patch)
treecafcbef8c46a557b91ddcd4f5d7cc26afb153f78 /SConstruct
parentd67fd52e5093a52452c393f598e361adc5bc9e49 (diff)
downloadmongo-3f3e8de9eaf73169b627fc2a8054ee6537a1795c.tar.gz
SERVER-40946 Autoset a reasonable concurrency level when icecream is enabled
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct11
1 files changed, 10 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index beda0cec47b..a14cc81545e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3821,10 +3821,19 @@ env.Alias("distsrc", "distsrc-tgz")
# reports the number of CPUs for the host system. Perhaps in a future version of
# psutil it will instead report the correct number when in a container.
#
+# The presence of the variable ICECC means the icecream tool is
+# enabled and so the default j value should scale accordingly. In this
+# scenario multiply the cpu count by 8 to set a reasonable default since the
+# cluster can handle many more jobs than your local machine but is
+# still throttled by your cpu count in the sense that you can only
+# handle so many python threads sending out jobs.
+#
# psutil.cpu_count returns None when it can't determine the number. This always
# fails on BSD's for example.
-if psutil.cpu_count() is not None:
+if psutil.cpu_count() is not None and 'ICECC' not in env:
env.SetOption('num_jobs', psutil.cpu_count())
+elif psutil.cpu_count() and 'ICECC' in env:
+ env.SetOption('num_jobs', 8 * psutil.cpu_count())
# Do this as close to last as possible before reading SConscripts, so