Last active
June 18, 2020 09:11
-
-
Save WebReflection/58729f1935467526167fbae2adcb4ebc to your computer and use it in GitHub Desktop.
Testing various CDN/Static files server on Raspberry Pi and others (ArchLinux here)
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
#!/usr/bin/env bash | |
echo "" | |
echo "benchmarking $(tput bold)$1$(tput sgr0)" | |
echo "" | |
case $1 in | |
nginx ) | |
sudo systemctl start nginx.service ;; | |
express ) | |
./express.js & ;; | |
ucdn ) | |
ucdn --source ./jellyfish & ;; | |
ucdn-forked ) | |
ucdn --source ./jellyfish --forks 128 & ;; | |
serve ) | |
serve ./jellyfish -p 8080 & ;; | |
fastify ) | |
./fastify.js & ;; | |
http-server ) | |
http-server ./jellyfish -s & ;; | |
esac | |
PID="$!" | |
page='http://127.0.0.1:8080/index.html' | |
while [ "$(curl -I $page 2> /dev/null)" = "" ]; do | |
sleep 0.1 | |
done | |
#wrk -t2 -c50 -d10s $page | |
autocannon -c 50 -t 10 $page | |
#for i in [1, 2, 3, 4, 5, 6]; do | |
# ab -n 100 -c 50 $page > bench.txt | |
# cat bench.txt | grep Request | |
# sleep 0.1 | |
#done | |
if [ "$1" = "nginx" ]; then | |
sudo systemctl stop nginx.service; | |
else | |
kill $PID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jellyfish Demo
https://github.com/WebReflection/archibold.io/tree/gh-pages/demo/
express.js
fastify.js