parent
f8c5bf6283
commit
f7ecc11a71
@ -0,0 +1,26 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
.PHONY: debug
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 nostop" \
|
||||||
|
--eval-command="handle SIGPIPE nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
.PHONY: client
|
||||||
|
client:
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/airplane1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/automobile1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/bird1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/cat1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/deer1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/dog1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/frog1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/horse1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/ship1.bmp" "localhost:10000"
|
||||||
|
@curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/truck1.bmp" "localhost:10000"
|
@ -0,0 +1,27 @@
|
|||||||
|
RUNTIME_DIR=../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
all: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@initial_state.dat" "${HOSTNAME}:10000" --output result1.dat
|
||||||
|
diff -s result1.dat one_iteration.dat
|
||||||
|
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@result1.dat" "${HOSTNAME}:10000" --output result2.dat
|
||||||
|
diff -s result2.dat two_iterations.dat
|
||||||
|
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@result2.dat" "${HOSTNAME}:10000" --output result3.dat
|
||||||
|
diff -s result3.dat three_iterations.dat
|
||||||
|
rm result*.dat
|
@ -0,0 +1,22 @@
|
|||||||
|
RUNTIME_DIR=../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
all: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" "${HOSTNAME}:10000" --output result.dat
|
||||||
|
diff -s result.dat expected_result.dat
|
@ -0,0 +1,13 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
@ -0,0 +1,20 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
.PHONY: debug
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
.PHONY: client
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" "${HOSTNAME}:10000"
|
@ -0,0 +1,47 @@
|
|||||||
|
RUNTIME_DIR=../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
SLEDGE_TESTS_DIR=${RUNTIME_DIR}/tests
|
||||||
|
HOSTNAME=localhost
|
||||||
|
DURATION_SEC=15
|
||||||
|
|
||||||
|
all: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make -C ${RUNTIME_DIR} clean
|
||||||
|
make -C ${SLEDGE_TESTS_DIR} clean
|
||||||
|
rm -f ${SLEDGE_BINARY_DIR}/fibonacci.wasm.so
|
||||||
|
|
||||||
|
${SLEDGE_BINARY_DIR}/sledgert:
|
||||||
|
make -C ${RUNTIME_DIR} runtime
|
||||||
|
|
||||||
|
.PHONY: sledgert
|
||||||
|
sledgert: ${SLEDGE_BINARY_DIR}/sledgert
|
||||||
|
|
||||||
|
${SLEDGE_BINARY_DIR}/fibonacci.wasm.so:
|
||||||
|
make -C .. fibonacci.install
|
||||||
|
|
||||||
|
.PHONY: fibonacci
|
||||||
|
fibonacci: ${SLEDGE_BINARY_DIR}/fibonacci.wasm.so
|
||||||
|
|
||||||
|
run: sledgert fibonacci
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug: sledgert fibonacci
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 \
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
client-fib10-once:
|
||||||
|
echo "10" | http :10010
|
||||||
|
|
||||||
|
client-fib40-once:
|
||||||
|
echo "40" | http :10040
|
||||||
|
|
||||||
|
client-preempt:
|
||||||
|
(echo "40" | http :10040 &); echo "10" | http :10010
|
||||||
|
|
||||||
|
client-fib10-multi:
|
||||||
|
hey -z ${DURATION_SEC}s -cpus 4 -c 100 -t 0 -o csv -m GET -d "10\n" "http://${HOSTNAME}:10010"
|
@ -0,0 +1,37 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
client-72dpi:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --dpi=72 --font=mono -qo tmp/72_dpi.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/72_dpi.png > tmp/72_dpi.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/72_dpi.pnm "${HOSTNAME}:10000"
|
||||||
|
rm -rf tmp
|
||||||
|
|
||||||
|
client-108dpi:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --dpi=108 --font=mono -qo tmp/108_dpi.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/108_dpi.png > tmp/108_dpi.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/108_dpi.pnm "${HOSTNAME}:10001"
|
||||||
|
rm -rf tmp
|
||||||
|
|
||||||
|
client-144dpi:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --dpi=144 --font=mono -qo tmp/144_dpi.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/144_dpi.png > tmp/144_dpi.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/144_dpi.pnm "${HOSTNAME}:10002"
|
||||||
|
rm -rf tmp
|
@ -0,0 +1,37 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
client-dejavu_sans_mono:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --font="DejaVu Sans Mono" -qo tmp/10_words.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/10_words.png > tmp/10_words.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000"
|
||||||
|
rm -rf tmp
|
||||||
|
|
||||||
|
client-roboto:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --font="Roboto" -qo tmp/10_words.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/10_words.png > tmp/10_words.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000"
|
||||||
|
rm -rf tmp
|
||||||
|
|
||||||
|
client-cascadia_code:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --font="Cascadia Code" -qo tmp/10_words.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/10_words.png > tmp/10_words.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000"
|
||||||
|
rm -rf tmp
|
@ -0,0 +1,21 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
client-10:
|
||||||
|
mkdir -p tmp
|
||||||
|
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
|
||||||
|
pango-view --font=mono -qo tmp/10_words.png tmp/10_words.txt
|
||||||
|
pngtopnm tmp/10_words.png > tmp/10_words.pnm
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000"
|
||||||
|
rm -rf tmp
|
@ -0,0 +1,16 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@5x8.pnm" "${HOSTNAME}:10000"
|
@ -0,0 +1,16 @@
|
|||||||
|
SLEDGE_BINARY_DIR=../../../runtime/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
|
||||||
|
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@handwrt1.pnm" "${HOSTNAME}:10000"
|
@ -1 +0,0 @@
|
|||||||
res
|
|
@ -1 +0,0 @@
|
|||||||
*.txt
|
|
@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Generates payloads of 1KB, 10KB, 100KB, 1MB
|
|
||||||
for size in 1024 $((1024 * 10)) $((1024 * 100)) $((1024 * 1024)); do
|
|
||||||
# If the file exists, but is not the right size, wipe it
|
|
||||||
if [[ -f "$size.txt" ]] && (("$(wc -c "$size.txt" | cut -d\ -f1)" != size)); then
|
|
||||||
rm -rf "$size.txt"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Regenerate the file if missing
|
|
||||||
if [[ ! -f "$size.txt" ]]; then
|
|
||||||
echo -n "Generating $size: "
|
|
||||||
for ((i = 0; i < size; i++)); do
|
|
||||||
printf 'a' >> $size.txt
|
|
||||||
done
|
|
||||||
echo "[OK]"
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
@ -1,2 +0,0 @@
|
|||||||
SLEDGE_SCHEDULER=EDF
|
|
||||||
SLEDGE_DISABLE_PREEMPTION=true
|
|
@ -1,3 +0,0 @@
|
|||||||
SLEDGE_SCHEDULER=EDF
|
|
||||||
SLEDGE_DISABLE_PREEMPTION=false
|
|
||||||
SLEDGE_SIGALRM_HANDLER=TRIAGED
|
|
@ -1,2 +0,0 @@
|
|||||||
SLEDGE_SCHEDULER=FIFO
|
|
||||||
SLEDGE_DISABLE_PREEMPTION=true
|
|
@ -1,2 +0,0 @@
|
|||||||
SLEDGE_SCHEDULER=FIFO
|
|
||||||
SLEDGE_DISABLE_PREEMPTION=false
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if ! command -v hey > /dev/null; then
|
|
||||||
HEY_URL=https://hey-release.s3.us-east-2.amazonaws.com/hey_linux_amd64
|
|
||||||
wget $HEY_URL -O hey
|
|
||||||
chmod +x hey
|
|
||||||
|
|
||||||
if [[ $(whoami) == "root" ]]; then
|
|
||||||
mv hey /usr/bin/hey
|
|
||||||
else
|
|
||||||
sudo mv hey /usr/bin/hey
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,20 +0,0 @@
|
|||||||
reset
|
|
||||||
|
|
||||||
set term jpeg
|
|
||||||
set output "latency.jpg"
|
|
||||||
|
|
||||||
set xlabel "Payload (bytes)"
|
|
||||||
set xrange [-5:1050000]
|
|
||||||
|
|
||||||
set ylabel "Latency (ms)"
|
|
||||||
set yrange [0:]
|
|
||||||
|
|
||||||
set key left top
|
|
||||||
|
|
||||||
|
|
||||||
set style histogram columnstacked
|
|
||||||
|
|
||||||
plot 'latency.dat' using 1:2 title 'p50', \
|
|
||||||
'latency.dat' using 1:3 title 'p90', \
|
|
||||||
'latency.dat' using 1:4 title 'p99', \
|
|
||||||
'latency.dat' using 1:5 title 'p100', \
|
|
@ -1,175 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# This experiment is intended to document how the level of concurrent requests influences
|
|
||||||
# - latency
|
|
||||||
# - throughput
|
|
||||||
# - success/failure rate
|
|
||||||
|
|
||||||
# Add bash_libraries directory to path
|
|
||||||
__run_sh__base_path="$(dirname "$(realpath --logical "${BASH_SOURCE[0]}")")"
|
|
||||||
__run_sh__bash_libraries_relative_path="../bash_libraries"
|
|
||||||
__run_sh__bash_libraries_absolute_path=$(cd "$__run_sh__base_path" && cd "$__run_sh__bash_libraries_relative_path" && pwd)
|
|
||||||
export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
|
|
||||||
|
|
||||||
# Source libraries from bash_libraries directory
|
|
||||||
source path_join.sh || exit 1
|
|
||||||
source framework.sh || exit 1
|
|
||||||
source get_result_count.sh || exit 1
|
|
||||||
source generate_gnuplots.sh || exit 1
|
|
||||||
source percentiles_table.sh || exit 1
|
|
||||||
|
|
||||||
if ! command -v hey > /dev/null; then
|
|
||||||
echo "hey is not present."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Experiment Globals and Setups
|
|
||||||
declare -ar payloads=(1024 10240 102400 1048576)
|
|
||||||
|
|
||||||
declare -Ar ports=(
|
|
||||||
[1024]=10000
|
|
||||||
[10240]=10001
|
|
||||||
[102400]=10002
|
|
||||||
[1048576]=10003
|
|
||||||
)
|
|
||||||
|
|
||||||
declare -ri iterations=10000
|
|
||||||
|
|
||||||
# If the one of the expected body files doesn't exist, trigger the generation script.
|
|
||||||
cd "$__run_sh__base_path/body" && ./generate.sh && cd "$OLDPWD" || exit
|
|
||||||
|
|
||||||
run_samples() {
|
|
||||||
local hostname="$1"
|
|
||||||
|
|
||||||
# Scrape the perf window size from the source if possible
|
|
||||||
local -r perf_window_path="$(path_join "$__run_sh__base_path" ../../include/perf_window_t.h)"
|
|
||||||
local -i perf_window_buffer_size
|
|
||||||
if ! perf_window_buffer_size=$(grep "#define PERF_WINDOW_BUFFER_SIZE" < "$perf_window_path" | cut -d\ -f3); then
|
|
||||||
printf "Failed to scrape PERF_WINDOW_BUFFER_SIZE from ../../include/perf_window.h\n"
|
|
||||||
printf "Defaulting to 16\n"
|
|
||||||
perf_window_buffer_size=16
|
|
||||||
fi
|
|
||||||
local -ir perf_window_buffer_size
|
|
||||||
|
|
||||||
# Execute workloads long enough for runtime to learn excepted execution time
|
|
||||||
printf "Running Samples:\n"
|
|
||||||
for payload in "${payloads[@]}"; do
|
|
||||||
printf "\t%d Payload: " "$payload"
|
|
||||||
hey -disable-compression -disable-keepalive -disable-redirects -n "$perf_window_buffer_size" -c "$perf_window_buffer_size" -q 200 -o csv -m GET -D "$__run_sh__base_path/body/$payload.txt" "http://$hostname:${ports["$payload"]}" 1> /dev/null 2> /dev/null || {
|
|
||||||
printf "[ERR]\n"
|
|
||||||
panic "samples failed"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
printf "[OK]\n"
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
run_experiments() {
|
|
||||||
if (($# != 2)); then
|
|
||||||
panic "invalid number of arguments \"$1\""
|
|
||||||
return 1
|
|
||||||
elif [[ ! -d "$2" ]]; then
|
|
||||||
panic "directory \"$2\" does not exist"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local hostname="$1"
|
|
||||||
local results_directory="$2"
|
|
||||||
|
|
||||||
# Execute the experiments
|
|
||||||
printf "Running Experiments:\n"
|
|
||||||
for payload in "${payloads[@]}"; do
|
|
||||||
printf "\t%d Payload: " "$payload"
|
|
||||||
hey -disable-compression -disable-keepalive -disable-redirects -n "$iterations" -c 1 -cpus 2 -o csv -m GET -D "$__run_sh__base_path/body/$payload.txt" "http://$hostname:${ports["$payload"]}" > "$results_directory/$payload.csv" 2> /dev/null || {
|
|
||||||
printf "[ERR]\n"
|
|
||||||
panic "$payload experiment failed"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
get_result_count "$results_directory/$payload.csv" || {
|
|
||||||
printf "[ERR]\n"
|
|
||||||
panic "$payload.csv unexpectedly has zero requests"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
printf "[OK]\n"
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
process_results() {
|
|
||||||
if (($# != 1)); then
|
|
||||||
panic "invalid number of arguments ($#, expected 1)"
|
|
||||||
return 1
|
|
||||||
elif ! [[ -d "$1" ]]; then
|
|
||||||
panic "directory $1 does not exist"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local -r results_directory="$1"
|
|
||||||
|
|
||||||
printf "Processing Results: "
|
|
||||||
|
|
||||||
printf "Payload,Success_Rate\n" >> "$results_directory/success.csv"
|
|
||||||
printf "Payload,Throughput\n" >> "$results_directory/throughput.csv"
|
|
||||||
percentiles_table_header "$results_directory/latency.csv" "Payload"
|
|
||||||
|
|
||||||
for payload in ${payloads[*]}; do
|
|
||||||
# Calculate Success Rate for csv
|
|
||||||
awk -F, '
|
|
||||||
$7 == 200 {ok++}
|
|
||||||
END{printf "'"$payload"',%3.5f\n", (ok / '"$iterations"' * 100)}
|
|
||||||
' < "$results_directory/$payload.csv" >> "$results_directory/success.csv"
|
|
||||||
|
|
||||||
# Filter on 200s, convery from s to ms, and sort
|
|
||||||
awk -F, '$7 == 200 {print ($1 * 1000)}' < "$results_directory/$payload.csv" \
|
|
||||||
| sort -g > "$results_directory/$payload-response.csv"
|
|
||||||
|
|
||||||
# Get Number of 200s
|
|
||||||
oks=$(wc -l < "$results_directory/$payload-response.csv")
|
|
||||||
((oks == 0)) && continue # If all errors, skip line
|
|
||||||
|
|
||||||
# We determine duration by looking at the timestamp of the last complete request
|
|
||||||
# TODO: Should this instead just use the client-side synthetic duration_sec value?
|
|
||||||
duration=$(tail -n1 "$results_directory/$payload.csv" | cut -d, -f8)
|
|
||||||
|
|
||||||
# Throughput is calculated as the mean number of successful requests per second
|
|
||||||
throughput=$(echo "$oks/$duration" | bc)
|
|
||||||
printf "%d,%f\n" "$payload" "$throughput" >> "$results_directory/throughput.csv"
|
|
||||||
|
|
||||||
# Generate Latency Data for csv
|
|
||||||
percentiles_table_row "$results_directory/$payload-response.csv" "$results_directory/latency.csv" "$payload"
|
|
||||||
|
|
||||||
# Delete scratch file used for sorting/counting
|
|
||||||
rm -rf "$results_directory/$payload-response.csv"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Transform csvs to dat files for gnuplot
|
|
||||||
for file in success latency throughput; do
|
|
||||||
printf "#" > "$results_directory/$file.dat"
|
|
||||||
tr ',' ' ' < "$results_directory/$file.csv" | column -t >> "$results_directory/$file.dat"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Generate gnuplots
|
|
||||||
generate_gnuplots "$results_directory" "$__run_sh__base_path" || {
|
|
||||||
printf "[ERR]\n"
|
|
||||||
panic "failed to generate gnuplots"
|
|
||||||
}
|
|
||||||
|
|
||||||
printf "[OK]\n"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Expected Symbol used by the framework
|
|
||||||
experiment_client() {
|
|
||||||
local -r target_hostname="$1"
|
|
||||||
local -r results_directory="$2"
|
|
||||||
|
|
||||||
run_samples "$target_hostname" || return 1
|
|
||||||
run_experiments "$target_hostname" "$results_directory" || return 1
|
|
||||||
process_results "$results_directory" || return 1
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
framework_init "$@"
|
|
@ -1,42 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "work1k",
|
|
||||||
"path": "work1k_wasm.so",
|
|
||||||
"port": 10000,
|
|
||||||
"expected-execution-us": 400,
|
|
||||||
"relative-deadline-us": 2000,
|
|
||||||
"http-req-size": 1548,
|
|
||||||
"http-resp-size": 1548,
|
|
||||||
"http-resp-content-type": "text/plain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "work10k",
|
|
||||||
"path": "work10k_wasm.so",
|
|
||||||
"port": 10001,
|
|
||||||
"expected-execution-us": 600,
|
|
||||||
"relative-deadline-us": 2000,
|
|
||||||
"http-req-size": 10480,
|
|
||||||
"http-resp-size": 10480,
|
|
||||||
"http-resp-content-type": "text/plain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "work100k",
|
|
||||||
"path": "work100k_wasm.so",
|
|
||||||
"port": 10002,
|
|
||||||
"expected-execution-us": 700,
|
|
||||||
"relative-deadline-us": 2000,
|
|
||||||
"http-req-size": 104800,
|
|
||||||
"http-resp-size": 104800,
|
|
||||||
"http-resp-content-type": "text/plain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "work1m",
|
|
||||||
"path": "work1m_wasm.so",
|
|
||||||
"port": 10003,
|
|
||||||
"expected-execution-us": 2000,
|
|
||||||
"relative-deadline-us": 6000,
|
|
||||||
"http-req-size": 1048776,
|
|
||||||
"http-resp-size": 1048776,
|
|
||||||
"http-resp-content-type": "text/plain"
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,12 +0,0 @@
|
|||||||
reset
|
|
||||||
|
|
||||||
set term jpeg
|
|
||||||
set output "success.jpg"
|
|
||||||
|
|
||||||
set xlabel "Payload (bytes)"
|
|
||||||
set xrange [-5:1050000]
|
|
||||||
|
|
||||||
set ylabel "% 2XX"
|
|
||||||
set yrange [0:110]
|
|
||||||
|
|
||||||
plot 'success.dat' using 1:2 title '2XX'
|
|
@ -1,13 +0,0 @@
|
|||||||
reset
|
|
||||||
|
|
||||||
set term jpeg
|
|
||||||
set output "throughput.jpg"
|
|
||||||
|
|
||||||
# TODO: Axis shouldn't be linear
|
|
||||||
set xlabel "Payload (bytes)"
|
|
||||||
set xrange [-5:1050000]
|
|
||||||
|
|
||||||
set ylabel "Requests/sec"
|
|
||||||
set yrange [0:]
|
|
||||||
|
|
||||||
plot 'throughput.dat' using 1:2 title 'Reqs/sec'
|
|
@ -0,0 +1,17 @@
|
|||||||
|
RUNTIME_DIR=../../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
|
||||||
|
all: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
@ -0,0 +1,21 @@
|
|||||||
|
RUNTIME_DIR=../../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
|
||||||
|
all: run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "result.jpg" "${HOSTNAME}:10000"
|
@ -0,0 +1,27 @@
|
|||||||
|
RUNTIME_DIR=../../../../runtime/
|
||||||
|
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
|
||||||
|
HOSTNAME=localhost
|
||||||
|
IMAGE=./images/Cars0.png
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: run
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -rf res/*
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run:
|
||||||
|
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
|
||||||
|
|
||||||
|
.PHONY: debug
|
||||||
|
debug:
|
||||||
|
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
|
||||||
|
--eval-command="handle SIGUSR1 noprint nostop" \
|
||||||
|
--eval-command="handle SIGPIPE noprint nostop" \
|
||||||
|
--eval-command="set pagination off" \
|
||||||
|
--eval-command="run spec.json"
|
||||||
|
|
||||||
|
.PHONY: client
|
||||||
|
client:
|
||||||
|
curl -H 'Expect:' -H "Content-Type: image/png" --data-binary "@${IMAGE}" "${HOSTNAME}:10000"
|
Loading…
Reference in new issue