start.sh 925 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # sudo sysctl -w net.inet.ip.portrange.first=12000
  3. # sudo sysctl -w net.inet.tcp.msl=1000
  4. # sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
  5. # sudo ulimit -n 100000
  6. # sysctl -n machdep.cpu.brand_string
  7. SERVER=127.0.0.1
  8. NUM=500
  9. CONCURRENT=60
  10. maxSockets=50
  11. DELAY=5
  12. POST=/post
  13. node sleep_server.js &
  14. sleep_server_pid=$!
  15. node proxy.js $maxSockets $SERVER &
  16. sleep 1
  17. node -v
  18. echo "$maxSockets maxSockets, $CONCURRENT concurrent, $NUM requests per concurrent, ${DELAY}ms delay"
  19. echo "keep alive"
  20. echo "siege -R siegerc -c $CONCURRENT -r $NUM -b http://localhost:1985${POST}/k/$DELAY"
  21. siege -R siegerc -c $CONCURRENT -r $NUM -b http://localhost:1985${POST}/k/$DELAY
  22. sleep 5
  23. echo "normal"
  24. echo "siege -R siegerc -c $CONCURRENT -r $NUM -b http://localhost:1985${POST}/$DELAY"
  25. siege -R siegerc -c $CONCURRENT -r $NUM -b http://localhost:1985${POST}/$DELAY
  26. sleep 3
  27. kill $sleep_server_pid
  28. kill %