diff options
-rwxr-xr-x | run-client.sh | 26 | ||||
-rwxr-xr-x | run-server.sh | 25 |
2 files changed, 51 insertions, 0 deletions
diff --git a/run-client.sh b/run-client.sh new file mode 100755 index 0000000..e4b0f8f --- /dev/null +++ b/run-client.sh @@ -0,0 +1,26 @@ +#! /bin/bash + +. config.sh + +function run { + $ods_path/bin/onlineDetectorSimulatorClient "$@" +} + +ip=$1 +mtu=1500 #max 9000 +[ -n "$1" ] || { echo "Usage: run <ip> [mtu]" ; exit 1 ; } +[ -n "$2" ] && mtu=$2 + + +int=$(ip route show to match "$ip" | grep src | awk '{ print $3 }') +ip link set $int mtu $mtu + +if [ $mtu -le 1500 ]; then + sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 40/' config.cfg + run 80000 "$ip" +elif [ $mtu -eq 9000 ]; then + sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 250/' config.cfg + run 20000 "$ip" +fi + + diff --git a/run-server.sh b/run-server.sh new file mode 100755 index 0000000..7d29c10 --- /dev/null +++ b/run-server.sh @@ -0,0 +1,25 @@ +#! /bin/bash + +. config.sh + +function run { + VMA_THREAD_MODE=3 VMA_MTU=0 VMA_RX_POLL=0 VMA_SELECT_POLL=0 VMA_RING_ALLOCATION_LOGIC_RX=20 VMA_RX_BUFS=800000 LD_PRELOAD=$vma_path/lib64/libvma.so.8.6.10 $ods_path/bin/onlineDetectorSimulatorServer "$@" +} + + +ip=$1 +mtu=1500 #max 9000 +[ -n "$1" ] || { echo "Usage: run <ip> [mtu]" ; exit 1 ; } +[ -n "$2" ] && mtu=$2 + +ipinfo=$(ip addr show | grep $ip) +[ $? -eq 0 ] || { echo "Specified IP $ip is not found" ; exit 1 ; } +int=$(echo $ipinfo | awk '{print $NF}') + +echo 1000000000 > /proc/sys/kernel/shmmax # 18446744073692774399 +echo 8000 > /proc/sys/vm/nr_hugepages # 0 + + + +ip link set $int mtu $mtu +run $ip |