benchmark: Set ephemeral ports properly on sunos
This commit is contained in:
parent
825af451fb
commit
ec7455558f
@ -6,12 +6,20 @@ node=${NODE:-./node}
|
|||||||
name=${NAME:-stacks}
|
name=${NAME:-stacks}
|
||||||
|
|
||||||
if type sysctl &>/dev/null; then
|
if type sysctl &>/dev/null; then
|
||||||
|
# darwin and linux
|
||||||
sudo sysctl -w net.inet.ip.portrange.first=12000
|
sudo sysctl -w net.inet.ip.portrange.first=12000
|
||||||
sudo sysctl -w net.inet.tcp.msl=1000
|
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
|
||||||
|
elif type /usr/sbin/ndd &>/dev/null; then
|
||||||
|
# sunos
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 12000
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65535
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_max_buf 2097152
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1048576
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1048576
|
||||||
fi
|
fi
|
||||||
ulimit -n 100000
|
|
||||||
|
|
||||||
|
ulimit -n 100000
|
||||||
$node benchmark/http_simple.js &
|
$node benchmark/http_simple.js &
|
||||||
nodepid=$!
|
nodepid=$!
|
||||||
echo "node pid = $nodepid"
|
echo "node pid = $nodepid"
|
||||||
@ -45,7 +53,7 @@ test () {
|
|||||||
|
|
||||||
echo 'Keep going until dtrace stops listening...'
|
echo 'Keep going until dtrace stops listening...'
|
||||||
while pargs $dtracepid &>/dev/null; do
|
while pargs $dtracepid &>/dev/null; do
|
||||||
test 100 bytes 1 -k
|
test 100 bytes ${LENGTH:-1} -k
|
||||||
done
|
done
|
||||||
|
|
||||||
kill $nodepid
|
kill $nodepid
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd "$(dirname "$(dirname $0)")"
|
cd "$(dirname "$(dirname $0)")"
|
||||||
sudo sysctl -w net.inet.ip.portrange.first=12000
|
|
||||||
sudo sysctl -w net.inet.tcp.msl=1000
|
if type sysctl &>/dev/null; then
|
||||||
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
|
# darwin and linux
|
||||||
|
sudo sysctl -w net.inet.ip.portrange.first=12000
|
||||||
|
sudo sysctl -w net.inet.tcp.msl=1000
|
||||||
|
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
|
||||||
|
elif type /usr/sbin/ndd &>/dev/null; then
|
||||||
|
# sunos
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 12000
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65535
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_max_buf 2097152
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1048576
|
||||||
|
/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1048576
|
||||||
|
fi
|
||||||
|
|
||||||
ulimit -n 100000
|
ulimit -n 100000
|
||||||
|
|
||||||
k=${KEEPALIVE}
|
k=${KEEPALIVE}
|
||||||
@ -15,6 +27,7 @@ node=${NODE:-./node}
|
|||||||
|
|
||||||
$node benchmark/http_simple.js &
|
$node benchmark/http_simple.js &
|
||||||
npid=$!
|
npid=$!
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
if [ "$k" = "-k" ]; then
|
if [ "$k" = "-k" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user