corda/sizing.sh
Stefano Franz 88894bc592
add a shared memory port allocator to allow multiple processes to sha… (#5223)
* add a shared memory port allocator to allow multiple processes to share a single allocation pool

* remove dangerous reset function on port allocator

* set forkCount = 2 in node integration test

* only allow one build of a cordapp at any given time for Driver tests

* make all portallocation requests use same starting point

* globally set forks to 6

* tweak forking parameters to allow parallel builds

* tweak unit test parallelism

* 2 workers for integrationTest

* some more tweaks for parallel builds

* some more tweaks for parallel builds

* seems that 49K is not the start of ephemeral ports on all kernels

* tweak parallel settings

* try fix RPC shutdown test in parallel env

* add some logging for RPC shutdown test

* added some logging around PortAllocation tests - try figure out where they are getting stuck

* added some logging around PortAllocation tests - try figure out where they are getting stuck

* fix api-scanner tests

* minimize api changes

* revert to complying with existing API

* add the AtomicInteger for api compatibility reasons

* make sizing script executable

* address review comments pt1

* address review comments pt2

* fix compile errors after review comments

* return to using home dir as temp dir seemed to interact badly with gradle
2019-07-02 18:38:33 +00:00

33 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
echo "Running in shell $(ps -ef | grep $$ | grep -v grep)"
NUM_CPU=$(nproc)
if test ${NUM_CPU} -le 8 ; then
CORDA_CORE_TESTING_FORKS=1
CORDA_NODE_INT_TESTING_FORKS=1
CORDA_NODE_TESTING_FORKS=1
CORDA_INT_TESTING_FORKS=1
CORDA_TESTING_FORKS=1
elif test ${NUM_CPU} -gt 8 && test ${NUM_CPU} -le 16 ; then
CORDA_CORE_TESTING_FORKS=2
CORDA_NODE_INT_TESTING_FORKS=2
CORDA_NODE_TESTING_FORKS=2
CORDA_INT_TESTING_FORKS=2
CORDA_TESTING_FORKS=2
elif test ${NUM_CPU} -gt 16 && test ${NUM_CPU} -le 32 ; then
CORDA_CORE_TESTING_FORKS=4
CORDA_NODE_INT_TESTING_FORKS=4
CORDA_NODE_TESTING_FORKS=4
CORDA_INT_TESTING_FORKS=2
CORDA_TESTING_FORKS=2
else
CORDA_CORE_TESTING_FORKS=8
CORDA_NODE_INT_TESTING_FORKS=8
CORDA_NODE_TESTING_FORKS=8
CORDA_INT_TESTING_FORKS=4
CORDA_TESTING_FORKS=4
fi
echo "CORDA_CORE_TESTING_FORKS=${CORDA_CORE_TESTING_FORKS}" >> /etc/environment
echo "CORDA_NODE_INT_TESTING_FORKS=${CORDA_NODE_INT_TESTING_FORKS}" >> /etc/environment
echo "CORDA_NODE_TESTING_FORKS=${CORDA_NODE_TESTING_FORKS}" >> /etc/environment
echo "CORDA_INT_TESTING_FORKS=${CORDA_INT_TESTING_FORKS}" >> /etc/environment
echo "CORDA_TESTING_FORKS=${CORDA_TESTING_FORKS}" >> /etc/environment