summaryrefslogtreecommitdiffstats
path: root/run-server.sh
blob: 51f947d1c413e0e66b8fd61083c518aace16c3f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash

. config.sh

function run {
    bufs=800000
    [ $ip == "0.0.0.0" ] && bufs=$((bufs * 4))

#    VMA_TRACELEVEL=DEBUG VMA_THREAD_MODE=3 VMA_MTU=0 VMA_RX_POLL=0 VMA_SELECT_POLL=0 VMA_RING_ALLOCATION_LOGIC_RX=20 VMA_RX_BUFS=$bufs LD_PRELOAD=$vma_lib $ods_path/bin/onlineDetectorSimulatorServer "$@"
    VMA_THREAD_MODE=3 VMA_MTU=0 VMA_RX_POLL=0 VMA_SELECT_POLL=0 VMA_RING_ALLOCATION_LOGIC_RX=20 VMA_RX_BUFS=$bufs LD_PRELOAD=$vma_lib $ods_path/bin/onlineDetectorSimulatorServer "$@"
#    $ods_path/bin/onlineDetectorSimulatorServer "$@"
}


ip=$1
first_port=4000
num_ports=27
mtu=1500 #max 9000
[ -n "$1" ] || { echo "Usage: run <ip> [first_port] [num_ports] [mtu]" ; exit 1 ; }
[ -n "$2" ] && first_port=$2
[ -n "$3" ] && num_ports=$3
[ -n "$4" ] && mtu=$4

echo 1000000000 > /proc/sys/kernel/shmmax	# 18446744073692774399
echo 8000 > /proc/sys/vm/nr_hugepages		# 0


if [ $ip != "0.0.0.0" ]; then
    ipinfo=$(ip addr show | grep $ip)
    [ $? -eq 0 ] || { echo "Specified IP $ip is not found" ; exit 1 ; }
    int=$(echo $ipinfo | awk '{print $NF}')

    ip link set $int mtu $mtu
fi

run $ip $first_port $num_ports