bench.sh 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash -e
  2. leader=http://10.240.201.15:4001
  3. # assume three servers
  4. servers=( http://10.240.201.15:4001 http://10.240.212.209:4001 http://10.240.95.3:4001 )
  5. keyarray=( 64 256 )
  6. for keysize in ${keyarray[@]}; do
  7. echo write, 1 client, $keysize key size, to leader
  8. ./boom -m PUT -n 10 -readall -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 1 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  9. echo write, 64 client, $keysize key size, to leader
  10. ./boom -m PUT -n 640 -readall -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 64 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  11. echo write, 256 client, $keysize key size, to leader
  12. ./boom -m PUT -n 2560 -readall -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 256 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  13. echo write, 64 client, $keysize key size, to all servers
  14. for i in ${servers[@]}; do
  15. ./boom -m PUT -n 210 -readall -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 21 -T application/x-www-form-urlencoded $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo &
  16. done
  17. # wait for all booms to start running
  18. sleep 3
  19. # wait for all booms to finish
  20. for pid in $(pgrep 'boom'); do
  21. while kill -0 "$pid" 2> /dev/null; do
  22. sleep 3
  23. done
  24. done
  25. echo write, 256 client, $keysize key size, to all servers
  26. for i in ${servers[@]}; do
  27. ./boom -m PUT -n 850 -readall -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 85 -T application/x-www-form-urlencoded $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo &
  28. done
  29. sleep 3
  30. for pid in $(pgrep 'boom'); do
  31. while kill -0 "$pid" 2> /dev/null; do
  32. sleep 3
  33. done
  34. done
  35. echo read, 1 client, $keysize key size, to leader
  36. ./boom -n 100 -c 1 -readall $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  37. echo read, 64 client, $keysize key size, to leader
  38. ./boom -n 6400 -c 64 -readall $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  39. echo read, 256 client, $keysize key size, to leader
  40. ./boom -n 25600 -c 256 -readall $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  41. echo read, 64 client, $keysize key size, to all servers
  42. # bench servers one by one, so it doesn't overload this benchmark machine
  43. # It doesn't impact correctness because read request doesn't involve peer interaction.
  44. for i in ${servers[@]}; do
  45. ./boom -n 21000 -c 21 -readall $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  46. done
  47. echo read, 256 client, $keysize key size, to all servers
  48. for i in ${servers[@]}; do
  49. ./boom -n 85000 -c 85 -readall $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
  50. done
  51. done