-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbenchmark.sh
executable file
·67 lines (51 loc) · 1.16 KB
/
benchmark.sh
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
60
61
62
63
64
65
66
67
#!/bin/bash
# verbose output
set -x
source ../common/set-cpus.sh
source ../common/nginx.sh
source ../common/network.sh
source ../common/qemu.sh
IMAGES=images/
BASEIP=172.190.0
NETIF=unikraft0
mkdir -p rawdata results
create_bridge $NETIF $BASEIP
kill_qemu
# run dnsmasq
dnsmasq_pid=$(run_dhcp $NETIF $BASEIP)
function cleanup {
# kill all children (evil)
kill_dhcp $dnsmasq_pid
delete_bridge $NETIF
kill_qemu
pkill -P $$
}
trap "cleanup" EXIT
for alloc in "buddy" "tinyalloc" "mimalloc" "tlsf"
do
RESULTS=results/${alloc}.csv
echo "throughput_reqs" > $RESULTS
LOG=rawdata/${alloc}.txt
touch $LOG
for j in {1..5}
do
taskset -c ${CPU1} qemu-guest \
-i nginx.cpio \
-k ${IMAGES}/unikraft+${alloc}.kernel \
-a "" -m 1024 -p ${CPU2} \
-b ${NETIF} -x
child_pid=$!
# make sure that the server has properly started
sleep 5
ip=`cat $(pwd)/dnsmasq.log | \
grep "dnsmasq-dhcp: DHCPACK(${NETIF})" | \
tail -n 1 | awk '{print $3}'`
# benchmark
benchmark_nginx_server ${ip} $LOG
#curl http://${BASEIP}.2/index.html --noproxy ${BASEIP}.2 --output -
# stop server
kill -9 $child_pid
kill_qemu
done
parse_nginx_results $LOG $RESULTS
done