diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2019-05-06 15:38:00 -0400 |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2019-05-13 10:44:50 -0400 |
commit | 3f3e8de9eaf73169b627fc2a8054ee6537a1795c (patch) | |
tree | cafcbef8c46a557b91ddcd4f5d7cc26afb153f78 /SConstruct | |
parent | d67fd52e5093a52452c393f598e361adc5bc9e49 (diff) | |
download | mongo-3f3e8de9eaf73169b627fc2a8054ee6537a1795c.tar.gz |
SERVER-40946 Autoset a reasonable concurrency level when icecream is enabled
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 11 |
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 |