-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-cross-instance.sh
More file actions
executable file
·59 lines (44 loc) · 1.81 KB
/
run-cross-instance.sh
File metadata and controls
executable file
·59 lines (44 loc) · 1.81 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
target_host=${1:-"127.0.0.1"}
scenario=${2:-"single_instance_proxy"}
variation=${3:-"s"} # s: server, c: client, b: both varying in size
instance_type=$(ec2-metadata --instance-type | cut -d ' ' -f 2)
file_name="$scenario-$instance_type-$(date --utc +%FT%TZ | tr : _ | tr - _)-$(git rev-parse --short HEAD).csv"
export RESULT_FILE=$file_name
msg_sizes=""
for exp in $(seq 5 20); do
msg_sizes="$msg_sizes $((2**exp))"
done
# Find the maximum value in msg_sizes - at least 1024
buf_size=$(echo "$msg_sizes 1024" | tr ' ' '\n' | sort -n | tail -1)
n_runs=${n_runs:-10}
export TIMEOUT_SEC=${timeout_sec:-10}
export PRINT_HEADER=yes
export CLIENT_TARGET_ADDR=$target_host
for i in $(seq 1 "$n_runs"); do
if [[ "$variation" == *"s"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - fix request size (8 byte)..."
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=8 CLIENT_BUF_SIZE=$buf_size SERVER_RSP_SIZE=$msg_size run-host-client2host
export PRINT_HEADER=""
done
make upload-results
fi
if [[ "$variation" == *"c"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - fix response size (8 byte)..."
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=$msg_size SERVER_BUF_SIZE=$buf_size SERVER_RSP_SIZE=8 run-host-client2host
export PRINT_HEADER=""
done
make upload-results
fi
if [[ "$variation" == *"b"* ]]; then
echo "[$(date +"%y-%m-%d-%H:%M:%S")] Run $i - equal msg sizes 4 client & server..."
for msg_size in $msg_sizes; do
make CLIENT_MSG_SIZE=$msg_size SERVER_RSP_SIZE=$msg_size CLIENT_BUF_SIZE=$buf_size SERVER_BUF_SIZE=$buf_size run-host-client2host
export PRINT_HEADER=""
done
make upload-results
fi
done
echo "Done."