run_ffead.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/sh
  2. echo never > /sys/kernel/mm/transparent_hugepage/enabled
  3. echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.local
  4. sysctl vm.overcommit_memory=1
  5. export PATH=${IROOT}/nginxfc/sbin:${PATH}
  6. export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:$LD_LIBRARY_PATH
  7. export ODBCINI=${IROOT}/odbc.ini
  8. export ODBCSYSINI=${IROOT}
  9. cd $FFEAD_CPP_PATH
  10. #use below settings only for debugging
  11. #echo '/tmp/core.%h.%e.%t' > /proc/sys/kernel/core_pattern
  12. #ulimit -c unlimited
  13. service redis-server stop
  14. service apache2 stop
  15. service memcached stop
  16. rm -f web/te-benchmark/config/cache.xml
  17. if [ $2 = "redis" ]
  18. then
  19. service redis-server start
  20. rm -rf lib
  21. cp -f web/te-benchmark/config/cacheredis.xml web/te-benchmark/config/cache.xml
  22. cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
  23. cp -rf lib-mongo lib
  24. fi
  25. if [ $2 = "memcached" ]
  26. then
  27. service memcached start
  28. rm -rf lib
  29. cp -f web/te-benchmark/config/cachememcached.xml web/te-benchmark/config/cache.xml
  30. cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
  31. cp -rf lib-mongo lib
  32. fi
  33. if [ $2 = "mongo" ]
  34. then
  35. rm -rf lib
  36. cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
  37. cp -rf lib-mongo lib
  38. fi
  39. if [ $2 = "mysql" ]
  40. then
  41. rm -rf lib
  42. cp -f web/te-benchmark/config/sdormmysql.xml web/te-benchmark/config/sdorm.xml
  43. cp -rf lib-sql lib
  44. fi
  45. if [ $2 = "postgresql" ]
  46. then
  47. rm -rf lib
  48. cp -f web/te-benchmark/config/sdormpostgresql.xml web/te-benchmark/config/sdorm.xml
  49. cp -rf lib-sql lib
  50. fi
  51. rm -f rtdcf/*.d rtdcf/*.o
  52. rm -f *.cntrl
  53. rm -f tmp/*.sess
  54. if [ ! -d tmp ]; then
  55. mkdir tmp
  56. fi
  57. chmod 700 CHS*
  58. chmod 700 resources/*.sh
  59. chmod 700 tests/*
  60. chmod 700 rtdcf/*
  61. if [ $1 = "emb" ]
  62. then
  63. ./CHS $FFEAD_CPP_PATH
  64. fi
  65. if [ $1 = "apache" ]
  66. then
  67. sed -i 's|<pool-size>20</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
  68. sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
  69. apachectl -D FOREGROUND
  70. fi
  71. if [ $1 = "nginx" ]
  72. then
  73. sed -i 's|<pool-size>20</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
  74. sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
  75. nginx -g 'daemon off;'
  76. fi
  77. wait