2 cd "$(dirname "$(dirname $0)")"
4 if type sysctl &>/dev/null; then
6 sudo sysctl -w net.ipv4.ip_local_port_range="12000 65535"
7 sudo sysctl -w net.inet.ip.portrange.first=12000
8 sudo sysctl -w net.inet.tcp.msl=1000
9 sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
10 elif type /usr/sbin/ndd &>/dev/null; then
12 /usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 12000
13 /usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65535
14 /usr/sbin/ndd -set /dev/tcp tcp_max_buf 2097152
15 /usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1048576
16 /usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1048576
22 if [ "$k" = "no" ]; then
29 $node benchmark/http_simple.js &
34 if [ "$k" = "-k" ]; then
35 echo "using keepalive"
38 for i in a a a a a a a a a a a a a a a a a a a a; do
39 ab $k -t 10 -c 100 http://127.0.0.1:8000/${TYPE:-bytes}/${LENGTH:-1024} \
40 2>&1 | grep Req | egrep -o '[0-9\.]+'