We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79ec9dc commit 825af45Copy full SHA for 825af45
1 file changed
benchmark/http.sh
@@ -5,8 +5,25 @@ sudo sysctl -w net.inet.tcp.msl=1000
5
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
6
ulimit -n 100000
7
8
-./node benchmark/http_simple.js || exit 1 &
+k=${KEEPALIVE}
9
+if [ "$k" = "no" ]; then
10
+ k=""
11
+else
12
+ k="-k"
13
+fi
14
+node=${NODE:-./node}
15
+
16
+$node benchmark/http_simple.js &
17
+npid=$!
18
sleep 1
19
-ab -n 30000 -c 100 http://127.0.0.1:8000/${TYPE:-bytes}/${LENGTH:-1024} | grep Req
-killall node
20
+if [ "$k" = "-k" ]; then
21
+ echo "using keepalive"
22
23
24
+for i in a a a a a a a a a a a a a a a a a a a a; do
25
+ ab $k -t 10 -c 100 http://127.0.0.1:8000/${TYPE:-bytes}/${LENGTH:-1024} \
26
+ 2>&1 | grep Req | egrep -o '[0-9\.]+'
27
+done
28
29
+kill $npid
0 commit comments