feat: Complete application experiment

sledge_graph
Sean McBride 5 years ago
parent e19d007ca7
commit 306eb39b16

@ -20,10 +20,10 @@ USE_MEM = USE_MEM_VM
# Debugging Flags
# Strips out calls to assert()
CFLAGS += -DNDEBUG
# CFLAGS += -DNDEBUG
# Turns on debuglog and other assorted printfs in third party libs
# CFLAGS += -DDEBUG
CFLAGS += -DDEBUG
# Redirects debuglogs to /runtime/bin/awesome.log
#FIXME This log should be changed to sledge.log (and likely to a user defined path)

@ -1,23 +0,0 @@
#!/bin/bash
expected_result="This is q handw__tten
examp(e for _0CR,
Write as good as yo_ c4n."
success_count=0
total_count=1000
for ((i = 0; i < total_count; i++)); do
echo "$i"
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@handwrt1.pnm" localhost:10000 2>/dev/null)
# echo "$result"
if [[ "$result" == "$expected_result" ]]; then
success_count=$((success_count + 1))
else
echo "FAIL"
echo "Expected $expected_result"
echo "Was $result"
fi
done
echo "$success_count / $total_count"

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,2 @@
pnm file was generated as follows
`pngtopnm 5x8.png >5x8.pnm`

@ -0,0 +1,19 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH"
export PATH="$binary_directory:$PATH"
gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="handle SIGPIPE nostop" \
--eval-command="set pagination off" \
--eval-command="set substitute-path /sledge/runtime $project_directory" \
--eval-command="run $experiment_directory/spec.json" \
sledgert

@ -0,0 +1,2 @@
ABCD abcd EFGHI efghi JKLMN jklmn OPQR opqr
STUVW stuvw XYZ xyz 12345 67890 !?'&/\=+-*#(){}[]<>

@ -0,0 +1,47 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
if [ "$1" != "-d" ]; then
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
sleep 1
else
echo "Running under gdb"
fi
expected_result="$(cat ./expected_result.txt)"
success_count=0
total_count=50
for ((i = 0; i < total_count; i++)); do
echo "$i"
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@5x8.pnm" localhost:10000 2>/dev/null)
# echo "$result"
if [[ "$result" == "$expected_result" ]]; then
success_count=$((success_count + 1))
else
echo "FAIL"
echo "Expected:"
echo "$expected_result"
echo "==============================================="
echo "Was:"
echo "$result"
fi
done
echo "$success_count / $total_count"
if [ "$1" != "-d" ]; then
sleep 5
echo -n "Running Cleanup: "
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi

@ -0,0 +1,14 @@
{
"active": "yes",
"name": "gocr",
"path": "gocr.aso",
"port": 10000,
"relative-deadline-us": 50000000000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "text/plain"
}

@ -0,0 +1,19 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH"
export PATH="$binary_directory:$PATH"
gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="handle SIGPIPE nostop" \
--eval-command="set pagination off" \
--eval-command="set substitute-path /sledge/runtime $project_directory" \
--eval-command="run $experiment_directory/spec.json" \
sledgert

@ -0,0 +1,3 @@
This is q handw__tten
examp(e for _0CR,
Write as good as yo_ c4n.

@ -0,0 +1,47 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
if [ "$1" != "-d" ]; then
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
sleep 1
else
echo "Running under gdb"
fi
expected_result="$(cat ./expected_result.txt)"
success_count=0
total_count=50
for ((i = 0; i < total_count; i++)); do
echo "$i"
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@handwrt1.pnm" localhost:10000 2>/dev/null)
# echo "$result"
if [[ "$result" == "$expected_result" ]]; then
success_count=$((success_count + 1))
else
echo "FAIL"
echo "Expected:"
echo "$expected_result"
echo "==============================================="
echo "Was:"
echo "$result"
fi
done
echo "$success_count / $total_count"
if [ "$1" != "-d" ]; then
sleep 5
echo -n "Running Cleanup: "
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi

@ -0,0 +1,14 @@
{
"active": "yes",
"name": "gocr",
"path": "gocr.aso",
"port": 10000,
"relative-deadline-us": 50000000000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "text/plain"
}

@ -0,0 +1,5 @@
# A Page from Dr. Jekyll and Mister Hyde
This is a larger OCR example. The \*.pnm file is 5mb or so.
In the future, this OCR example might be a good use case for a "step-wise" function, as the file is substantially smaller before conversion to the \*.pnm format.

@ -0,0 +1,19 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH"
export PATH="$binary_directory:$PATH"
gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="handle SIGPIPE nostop" \
--eval-command="set pagination off" \
--eval-command="set substitute-path /sledge/runtime $project_directory" \
--eval-command="run $experiment_directory/spec.json" \
sledgert

@ -0,0 +1,33 @@
at his to4ch of a certain icy pang along my blood. "Come, sir;' said I.
"Yo4 forget that I have not yet the pleas4re ofyo4r acq4aintance. Be
seated, if yo4 please: And I showed him an example, and sat down
myself in my c4stomary seat and with as fair an imitation of my or-
dinary manner to a patient, as the lateness of the ho4r, the nat4re of
my preocc4pations, and the horror I had of my visitor, wo4ld s4_er
me to m4ster.
"I beg yo4r pardon, Dr. Lanyon;' he replied civilly eno4gh. "What
yo4 say is very well fo4nded; and my impatience has shown its heels
to my politeness. I come here at the instance of yo4r colleag4e, Dr.
Henry _ekyll, on a piece of b4siness of some moment; and I 4nder-
stood.. ." He pa4sed and p4t his hand to his throat, and I co4ld see,
in spite of his collected manner, that he was wrestling against the
approaches of the hysteria-"I 4nderstood, a drawer.. ."
B4t here I took pity on my visito(0xed)s s4spense, and some perhaps
on my own growing c4riosity.
"mere it is, sir;' said I, pointing to the drawer, where it lay on the
noor behind a table and still covered with the sheet.
He sprang to it, and then pa4sed, and laid his hand 4pon his
heart; I co4ld hear his teeth grate with the conv4lsive action of his
jaws; and his face was so ghastly to see that I grew alarmed both for
his life and reason.
"Compose yo4rself_' said I.
He t4rned a dreadf4l smile to me, and as if with the decision of
despair, pl4cked away the sheet. At sight of the contents, he 4ttered
one lo4d sob of s4ch immense relief that I sat petri_ed. And the
next moment, in a voice that was already fairly well 4nder control,
"Have yo4 a grad4ated glass? " he asked.
I rose from my place with something of an e_ort and gave him
what he asked.
He thanked me with a smiling nod, meas4red o4t a few min-
ims of the red tinct4re and added one of the powders. me mix-
t4re, which was at _rst of a reddish h4e, began, in proportion as the

Before

Width:  |  Height:  |  Size: 823 KiB

After

Width:  |  Height:  |  Size: 823 KiB

@ -0,0 +1,46 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
if [ "$1" != "-d" ]; then
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
sleep 1
else
echo "Running under gdb"
fi
expected_result="$(cat ./expected_result.txt)"
success_count=0
total_count=50
for ((i = 0; i < total_count; i++)); do
echo "$i"
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@hyde.pnm" localhost:10000 2>/dev/null)
# echo "$result"
if [[ "$result" == "$expected_result" ]]; then
success_count=$((success_count + 1))
else
echo "FAIL"
echo "Expected:"
echo "$expected_result"
echo "==============================================="
echo "Was:"
echo "$result"
fi
done
echo "$success_count / $total_count"
if [ "$1" != "-d" ]; then
sleep 5
echo -n "Running Cleanup: "
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi

@ -0,0 +1,14 @@
{
"active": "yes",
"name": "gocr",
"path": "gocr.aso",
"port": 10000,
"relative-deadline-us": 50000000000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 5335057,
"http-resp-headers": [],
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}

@ -3,8 +3,8 @@ reset
set term jpeg
set output "latency.jpg"
set xlabel "Connections"
set xrange [-5:105]
set xlabel "Payload (bytes)"
set xrange [-5:1050000]
set ylabel "Latency (ms)"
set yrange [0:]

@ -51,18 +51,24 @@ else
echo "Running under gdb" >>"$results_directory/$log"
fi
payloads=(fivebyeight/5x8 handwriting/handwrt1 hyde/hyde)
ports=(10000 10001 10002)
iterations=1000
# Execute workloads long enough for runtime to learn excepted execution time
echo -n "Running Samples: "
hey -n 10000 -c 3 -q 200 -o csv -m GET http://localhost:10000
sleep 5
echo "[DONE]"
# echo -n "Running Samples: "
# for i in {0..2}; do
# hey -n 200 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/${payloads[$i]}.pnm" "http://localhost:${ports[$i]}"
# done
# sleep 1
# echo "[DONE]"
# Execute the experiments
concurrency=(1 20 40 60 80 100)
echo "Running Experiments"
for conn in ${concurrency[*]}; do
printf "\t%d Concurrency: " "$conn"
hey -n 10000 -c "$conn" -cpus 2 -o csv -m GET http://localhost:10000 >"$results_directory/con$conn.csv"
for i in {0..2}; do
printf "\t%s Payload: " "${payloads[$i]}"
file=$(echo "${payloads[$i]}" | awk -F/ '{print $2}').csv
hey -n "$iterations" -c 3 -cpus 2 -o csv -m GET -D "$experiment_directory/${payloads[$i]}.pnm" "http://localhost:${ports[$i]}" >"$results_directory/$file"
echo "[DONE]"
done
@ -83,24 +89,26 @@ printf "Concurrency,Success_Rate\n" >>"$results_directory/success.csv"
printf "Concurrency,Throughput\n" >>"$results_directory/throughput.csv"
printf "Con,p50,p90,p99,p100\n" >>"$results_directory/latency.csv"
for conn in ${concurrency[*]}; do
for payload in ${payloads[*]}; do
# Calculate Success Rate for csv
file=$(echo "$payload" | awk -F/ '{print $2}')
awk -F, '
$7 == 200 {ok++}
END{printf "'"$conn"',%3.5f\n", (ok / (NR - 1) * 100)}
' <"$results_directory/con$conn.csv" >>"$results_directory/success.csv"
END{printf "'"$file"',%3.5f\n", (ok / '"$iterations"' * 100)}
' <"$results_directory/$file.csv" >>"$results_directory/success.csv"
# Filter on 200s, convery from s to ms, and sort
awk -F, '$7 == 200 {print ($1 * 1000)}' <"$results_directory/con$conn.csv" |
sort -g >"$results_directory/con$conn-response.csv"
awk -F, '$7 == 200 {print ($1 * 1000)}' <"$results_directory/$file.csv" |
sort -g >"$results_directory/$file-response.csv"
# Get Number of 200s
oks=$(wc -l <"$results_directory/con$conn-response.csv")
oks=$(wc -l <"$results_directory/$file-response.csv")
((oks == 0)) && continue # If all errors, skip line
# Get Latest Timestamp
duration=$(tail -n1 "$results_directory/con$conn.csv" | cut -d, -f8)
duration=$(tail -n1 "$results_directory/$file.csv" | cut -d, -f8)
throughput=$(echo "$oks/$duration" | bc)
printf "%d,%f\n" "$conn" "$throughput" >>"$results_directory/throughput.csv"
printf "%s,%f\n" "$file" "$throughput" >>"$results_directory/throughput.csv"
# Generate Latency Data for csv
awk '
@ -110,16 +118,16 @@ for conn in ${concurrency[*]}; do
p90 = int('"$oks"' * 0.9)
p99 = int('"$oks"' * 0.99)
p100 = '"$oks"'
printf "'"$conn"',"
printf "'"$file"',"
}
NR==p50 {printf "%1.4f,", $0}
NR==p90 {printf "%1.4f,", $0}
NR==p99 {printf "%1.4f,", $0}
NR==p100 {printf "%1.4f\n", $0}
' <"$results_directory/con$conn-response.csv" >>"$results_directory/latency.csv"
' <"$results_directory/$file-response.csv" >>"$results_directory/latency.csv"
# Delete scratch file used for sorting/counting
rm -rf "$results_directory/con$conn-response.csv"
rm -rf "$results_directory/$file-response.csv"
done
# Transform csvs to dat files for gnuplot

@ -11,4 +11,33 @@
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "text/plain"
},
{
"active": "yes",
"name": "gocr",
"path": "gocr.aso",
"port": 10001,
"relative-deadline-us": 50000000000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "text/plain"
},
{
"active": "yes",
"name": "gocr",
"path": "gocr.aso",
"port": 10002,
"relative-deadline-us": 50000000000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 5335057,
"http-resp-headers": [],
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}

@ -0,0 +1,10 @@
#!/bin/bash
cd handwriting || exit
./run.sh
cd .. || exit
cd hyde || exit
./run.sh
cd .. || exit
cd fivebyeight || exit
./run.sh
cd ..

@ -51,9 +51,11 @@ else
echo "Running under gdb" >>"$results_directory/$log"
fi
iterations=10000
# Execute workloads long enough for runtime to learn excepted execution time
echo -n "Running Samples: "
hey -n 10000 -c 3 -q 200 -o csv -m GET http://localhost:10000
hey -n "$iterations" -c 3 -q 200 -o csv -m GET http://localhost:10000
sleep 5
echo "[DONE]"
@ -62,7 +64,7 @@ concurrency=(1 20 40 60 80 100)
echo "Running Experiments"
for conn in ${concurrency[*]}; do
printf "\t%d Concurrency: " "$conn"
hey -n 10000 -c "$conn" -cpus 2 -o csv -m GET http://localhost:10000 >"$results_directory/con$conn.csv"
hey -n "$iterations" -c "$conn" -cpus 2 -o csv -m GET http://localhost:10000 >"$results_directory/con$conn.csv"
echo "[DONE]"
done
@ -87,7 +89,7 @@ for conn in ${concurrency[*]}; do
# Calculate Success Rate for csv
awk -F, '
$7 == 200 {ok++}
END{printf "'"$conn"',%3.5f\n", (ok / (NR - 1) * 100)}
END{printf "'"$conn"',%3.5f\n", (ok / '"$iterations"' * 100)}
' <"$results_directory/con$conn.csv" >>"$results_directory/success.csv"
# Filter on 200s, convery from s to ms, and sort
@ -96,6 +98,7 @@ for conn in ${concurrency[*]}; do
# Get Number of 200s
oks=$(wc -l <"$results_directory/con$conn-response.csv")
((oks == 0)) && continue # If all errors, skip line
# Get Latest Timestamp
duration=$(tail -n1 "$results_directory/con$conn.csv" | cut -d, -f8)

@ -53,6 +53,8 @@ fi
payloads=(1024 10240 102400 1048576)
ports=(10000 10001 10002 10003)
iterations=10000
# If the one of the expected body files doesn't exist, trigger the generation script.
for payload in ${payloads[*]}; do
if test -f "$experiment_directory/body/$payload.txt"; then
@ -68,10 +70,10 @@ done
# Execute workloads long enough for runtime to learn excepted execution time
echo -n "Running Samples: "
hey -n 10000 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/1024.txt" http://localhost:10000
hey -n 10000 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/10240.txt" http://localhost:10001
hey -n 10000 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/102400.txt" http://localhost:10002
hey -n 10000 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/1048576.txt" http://localhost:10003
hey -n "$iterations" -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/1024.txt" http://localhost:10000
hey -n "$iterations" -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/10240.txt" http://localhost:10001
hey -n "$iterations" -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/102400.txt" http://localhost:10002
hey -n "$iterations" -c 3 -q 200 -o csv -m GET -D "$experiment_directory/body/1048576.txt" http://localhost:10003
sleep 5
echo "[DONE]"
@ -79,11 +81,11 @@ echo "[DONE]"
echo "Running Experiments"
for i in {0..3}; do
printf "\t%d Payload: " "${payloads[$i]}"
hey -n 10000 -c 1 -cpus 2 -o csv -m GET -D "$experiment_directory/body/${payloads[$i]}.txt" http://localhost:"${ports[$i]}" >"$results_directory/${payloads[$i]}.csv"
hey -n "$iterations" -c 1 -cpus 2 -o csv -m GET -D "$experiment_directory/body/${payloads[$i]}.txt" http://localhost:"${ports[$i]}" >"$results_directory/${payloads[$i]}.csv"
echo "[DONE]"
done
# Stop the runtime
# Stop the runtime
if [ "$1" != "-d" ]; then
sleep 5
echo -n "Running Cleanup: "
@ -103,7 +105,7 @@ for payload in ${payloads[*]}; do
# Calculate Success Rate for csv
awk -F, '
$7 == 200 {ok++}
END{printf "'"$payload"',%3.5f\n", (ok / (NR - 1) * 100)}
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
@ -112,6 +114,7 @@ for payload in ${payloads[*]}; do
# Get Number of 200s
oks=$(wc -l <"$results_directory/$payload-response.csv")
((oks == 0)) && continue # If all errors, skip line
# Get Latest Timestamp
duration=$(tail -n1 "$results_directory/$payload.csv" | cut -d, -f8)

Loading…
Cancel
Save