install_ffead-cpp-sql-raw-profiled.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. chmod +x $IROOT/ffead-cpp-sql-raw/*.sh
  3. cp $IROOT/ffead-cpp-sql-raw/server.sh /server_orig.sh
  4. cd $IROOT/ffead-cpp-sql-raw
  5. nohup bash -c "./server.sh > ffead.log &"
  6. echo "Waiting for ffead-cpp to launch on port 8080..."
  7. COUNTER=0
  8. while [ ! -f lib/libinter.so ]
  9. do
  10. sleep 1
  11. COUNTER=$((COUNTER+1))
  12. if [ "$COUNTER" = 600 ]
  13. then
  14. cat ffead.log
  15. cat logs/jobs.log
  16. echo "exiting...."
  17. exit 1
  18. fi
  19. done
  20. COUNTER=0
  21. while [ ! -f lib/libdinter.so ]
  22. do
  23. sleep 1
  24. COUNTER=$((COUNTER+1))
  25. if [ "$COUNTER" = 120 ]
  26. then
  27. cat ffead.log
  28. cat logs/jobs.log
  29. echo "exiting....dlib"
  30. exit 1
  31. fi
  32. done
  33. rm -f serv.ctrl
  34. pkill ffead-cpp
  35. #Start postgresql
  36. service postgresql start
  37. #For profiling/benchmarking
  38. sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' resources/server.prop
  39. nohup bash -c "./server.sh > ffead.log &"
  40. sleep 5
  41. echo "ffead-cpp with sql-raw support launched"
  42. wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
  43. -H 'Connection: keep-alive' --latency -d 15 -c 256 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/fortunes"
  44. wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
  45. -H 'Connection: keep-alive' --latency -d 15 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/db"
  46. wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
  47. -H 'Connection: keep-alive' --latency -d 15 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/queries?queries=20"
  48. wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
  49. -H 'Connection: keep-alive' --latency -d 15 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/updates?queries=20"
  50. echo "normal shutdown"
  51. rm -f serv.ctrl
  52. pkill ffead-cpp
  53. cd /
  54. exit 0