diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-08 08:51:58 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-08 08:51:58 +0000 |
commit | 32e30b5b236ccda77d462cd00e170d60e219dbd0 (patch) | |
tree | 265053254e33a913bad37aadff930c81c0232970 /vespabase | |
parent | b1015bd850fb94157d8c21077578e45628384e02 (diff) |
Detect that we are running in docker-on-mac and automatically reduce timer frequency due to expensive
calls to sample time. This might reduce timeout accuracy from 1ms to 10ms, but that is fine for development.
docker-on-mac will never be supported as production environment.
Diffstat (limited to 'vespabase')
-rwxr-xr-x | vespabase/src/common-env.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vespabase/src/common-env.sh b/vespabase/src/common-env.sh index 7e1fbf5d06a..09a7bff3a07 100755 --- a/vespabase/src/common-env.sh +++ b/vespabase/src/common-env.sh @@ -117,11 +117,21 @@ add_valgrind_suppressions_file() { fi } +optionally_reduce_base_frequency() { + os_release=`uname -r` + if [[ "$os_release" == *linuxkit* ]]; then + export VESPA_TIMER_HZ=100 + echo "Running docker on macos. Reducing base frequency from 1000hz to 100hz due to high cost of sampling time. This will reduce timeout accuracy. VESPA_TIMER_HZ=$VESPA_TIMER_HZ" + fi +} + populate_environment export LD_LIBRARY_PATH=$VESPA_HOME/lib64 export MALLOC_ARENA_MAX=1 +optionally_reduce_base_frequency + # Prefer newer gdb and pstack prepend_path /opt/rh/gcc-toolset-11/root/usr/bin |