Browse Source

benchmark: Make http.sh more useful

v0.9.4-release
isaacs 12 years ago
parent
commit
825af451fb
  1. 23
      benchmark/http.sh

23
benchmark/http.sh

@ -5,8 +5,25 @@ sudo sysctl -w net.inet.tcp.msl=1000
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000 sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
ulimit -n 100000 ulimit -n 100000
./node benchmark/http_simple.js || exit 1 & k=${KEEPALIVE}
if [ "$k" = "no" ]; then
k=""
else
k="-k"
fi
node=${NODE:-./node}
$node benchmark/http_simple.js &
npid=$!
sleep 1 sleep 1
ab -n 30000 -c 100 http://127.0.0.1:8000/${TYPE:-bytes}/${LENGTH:-1024} | grep Req if [ "$k" = "-k" ]; then
killall node echo "using keepalive"
fi
for i in a a a a a a a a a a a a a a a a a a a a; do
ab $k -t 10 -c 100 http://127.0.0.1:8000/${TYPE:-bytes}/${LENGTH:-1024} \
2>&1 | grep Req | egrep -o '[0-9\.]+'
done
kill $npid

Loading…
Cancel
Save