6 # You may want to configure your TCP settings to make many ports available
7 # to node and ab. On macintosh use:
8 # sudo sysctl -w net.inet.ip.portrange.first=32768
9 # sudo sysctl -w net.inet.tcp.msl=1000
11 if [ ! -d benchmark/ ]; then
12 echo "Run this script from the node root directory"
16 if [ $SERVER == "127.0.0.1" ]; then
17 ./iojs benchmark/http_simple.js &
22 date=`date "+%Y%m%d%H%M%S"`
27 if [ $type == "string" ]; then
28 local uri="bytes/$ressize"
30 local uri="buffer/$ressize"
34 name="ab-hello-world-$type-$ressize"
36 dir=".benchmark_reports/$name/$rev/"
37 if [ ! -d $dir ]; then
41 summary_fn="$dir/$date.summary"
42 data_fn="$dir/$date.data"
44 echo "Bench $name starts in 3 seconds..."
48 # hammer that as hard as it can for 10 seconds.
49 ab -g $data_fn -c 100 -t 10 http://$SERVER:$PORT/$uri > $summary_fn
51 # add our data about the server
54 echo "webserver-rev: $rev" >> $summary_fn
55 echo "webserver-uname: $uname" >> $summary_fn
59 echo "Summary: $summary_fn"
64 ab_hello_world 'string' '1024'
65 ab_hello_world 'buffer' '1024'
68 ab_hello_world 'string' '102400'
69 ab_hello_world 'buffer' '102400'
72 if [ ! -z $node_pid ]; then