-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #457 from luisgerhorst/bpf-spectre
RFC: Structure cicd/tcpsctpperf and add wrk2/nginx benchmark
- Loading branch information
Showing
7 changed files
with
276 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
set -x | ||
|
||
. "$(dirname $0)/../common.sh" | ||
|
||
set -u | ||
|
||
threads=$1 | ||
time=$2 | ||
dst="$3" | ||
|
||
cleanup() { | ||
set +e | ||
|
||
sudo pkill -SIGTERM iperf | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
$hexec l3ep1 \ | ||
iperf -s -p 12865 --reportstyle c \ | ||
> "${dst}server.csv" \ | ||
& | ||
# $! only gives use the pid of sudo. | ||
|
||
sleep 1 | ||
|
||
# --sum-only is not supported with CSV reportstyle. | ||
$hexec l3h1 \ | ||
iperf -c 20.20.20.1 -t $time -p 12865 -P $threads --reportstyle c \ | ||
> "${dst}client.csv" | ||
|
||
sudo pkill -SIGTERM iperf | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
set -x | ||
|
||
. "$(dirname $0)/../common.sh" | ||
|
||
set -u | ||
|
||
threads=$1 | ||
time=$2 | ||
dst="$3" | ||
|
||
cleanup() { | ||
set +e | ||
|
||
sudo pkill -SIGTERM iperf3 | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
$hexec l3ep1 \ | ||
iperf3 --server -p 13866 --json \ | ||
> "${dst}server.json" \ | ||
& | ||
# $! only gives use the pid of sudo. | ||
|
||
sleep 2 | ||
|
||
$hexec l3h1 \ | ||
iperf3 -c 20.20.20.1 -t $time -p 13866 -P $threads --sctp --json \ | ||
> "${dst}client.json" | ||
|
||
sudo pkill -SIGTERM iperf3 | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
set -x | ||
|
||
. "$(dirname $0)/../common.sh" | ||
|
||
set -u | ||
|
||
threads=$1 | ||
time=$2 | ||
dst="$3" | ||
|
||
cleanup() { | ||
set +e | ||
|
||
sudo pkill -SIGTERM iperf3 | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
$hexec l3ep1 \ | ||
iperf3 --server -p 12865 --json \ | ||
> "${dst}server.json" \ | ||
& | ||
# $! only gives use the pid of sudo. | ||
|
||
sleep 1 | ||
|
||
$hexec l3h1 \ | ||
iperf3 -c 20.20.20.1 -t $time -p 12865 -P $threads --json \ | ||
> "${dst}client.json" | ||
|
||
sudo pkill -SIGTERM iperf3 | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
set -x | ||
|
||
. "$(dirname $0)/../common.sh" | ||
|
||
set -u | ||
|
||
threads=$1 | ||
time=$2 | ||
dst="$3" | ||
|
||
cleanup() { | ||
set +e | ||
|
||
sudo pkill -SIGTERM netserver | ||
sudo pkill -SIGTERM netperf | ||
} | ||
|
||
trap cleanup EXIT | ||
trap cleanup SIGINT | ||
|
||
# Must be for TCP for this script. | ||
export OSE_NETPERF_TEST=${OSE_NETPERF_TEST:-TCP_CRR} | ||
export OSE_LATENCY_REQ_PAYLOAD_SIZE=${OSE_LATENCY_PAYLOAD_SIZE:-1} | ||
export OSE_LATENCY_PAYLOAD_SIZE=${OSE_LATENCY_PAYLOAD_SIZE:-1024} | ||
|
||
# Run as nobody to prevent /dev/null corruption | ||
# (https://github.com/HewlettPackard/netperf/issues/26). | ||
$hexec l3ep1 \ | ||
sudo -u nobody \ | ||
netserver -D -4 -p 12865 \ | ||
& | ||
# $! only gives use the pid of sudo. | ||
|
||
sleep 1 # await netserver, avoid 'could not establish control connection' | ||
|
||
for ((i=0,tport=12866;i<threads;i++,tport++)) | ||
do | ||
$hexec l3h1 \ | ||
netperf -L 10.10.10.1 -H 20.20.20.1 -t $OSE_NETPERF_TEST -l $time \ | ||
-- -P ,$tport -r ${OSE_LATENCY_REQ_PAYLOAD_SIZE},$OSE_LATENCY_PAYLOAD_SIZE \ | ||
> ${dst}client.$i.log \ | ||
& | ||
done | ||
|
||
sleep 10 # startup overhead | ||
sleep $time | ||
|
||
# netperf terminates by itself with -l. | ||
sudo pkill -SIGTERM netserver | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
set -x | ||
|
||
. "$(dirname $0)/../common.sh" | ||
|
||
set -u | ||
|
||
threads=$1 | ||
time=$2 | ||
dst="$3" | ||
|
||
cleanup() { | ||
set +e | ||
|
||
sudo pkill -SIGTERM nginx | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
OSE_NGINX_PAYLOAD=${OSE_NGINX_PAYLOAD:-1024} | ||
OSE_WRK_CONNECTIONS=${OSE_WRK_CONNECTIONS:-100} | ||
OSE_WRK_RATE=${OSE_WRK_RATE:-2000} | ||
|
||
# https://github.com/loxilb-io/loxilb/issues/449 | ||
for i in $(seq 1 $OSE_LOXILB_SERVERS) | ||
do | ||
tmpd=$(mktemp --directory --suffix=-$(basename $0)-$i) | ||
mkdir -p $tmpd/www | ||
echo "Hello World from $i" > $tmpd/www/hello-world.txt | ||
head --bytes=${OSE_LATENCY_PAYLOAD_SIZE} /dev/urandom > $tmpd/www/head-urandom | ||
|
||
echo " | ||
worker_processes 1; | ||
daemon off; # run in foreground | ||
events {} | ||
pid nginx.pid; | ||
error_log /dev/stderr; | ||
http { | ||
access_log off; | ||
client_body_temp_path .; | ||
proxy_temp_path .; | ||
fastcgi_temp_path .; | ||
uwsgi_temp_path .; | ||
scgi_temp_path .; | ||
server { | ||
server_name localhost; | ||
listen 14000; | ||
location / { | ||
root www; | ||
} | ||
} | ||
} | ||
" > $tmpd/nginx.conf | ||
|
||
$hexec l3ep$i \ | ||
nginx -p $tmpd -c nginx.conf \ | ||
> ${dst}nginx.log \ | ||
& | ||
done | ||
|
||
sleep $OSE_LOXILB_SERVERS | ||
|
||
set +e | ||
url=http://20.20.20.1:14000/hello-world.txt | ||
$hexec l3h1 \ | ||
curl $url | ||
|
||
url=http://20.20.20.1:14000/head-urandom | ||
$hexec l3h1 \ | ||
curl $url | wc --bytes | ||
|
||
$hexec l3h1 \ | ||
wrk --threads $threads --duration ${time}s --connections $OSE_WRK_CONNECTIONS --rate $OSE_WRK_RATE --latency $url \ | ||
> ${dst}latency.log | ||
ec=$? | ||
set -e | ||
|
||
sudo pkill -SIGTERM nginx | ||
wait | ||
|
||
exit $ec |