run_ffead.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:/usr/local/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 /tmp/cache.lock
  17. rm -f web/te-benchmark-um/config/cache.xml
  18. if [ $2 = "redis" ]
  19. then
  20. service redis-server start
  21. cp -f web/te-benchmark-um/config/cacheredis.xml web/te-benchmark-um/config/cache.xml
  22. cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
  23. fi
  24. if [ $2 = "memcached" ]
  25. then
  26. service memcached start
  27. cp -f web/te-benchmark-um/config/cachememcached.xml web/te-benchmark-um/config/cache.xml
  28. cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
  29. fi
  30. if [ $2 = "mongo" ]
  31. then
  32. cp -f web/te-benchmark-um/config/sdormmongo.xml web/te-benchmark-um/config/sdorm.xml
  33. fi
  34. if [ $2 = "mysql" ]
  35. then
  36. cp -f web/te-benchmark-um/config/sdormmysql.xml web/te-benchmark-um/config/sdorm.xml
  37. fi
  38. if [ $2 = "postgresql" ]
  39. then
  40. cp -f web/te-benchmark-um/config/sdormpostgresql.xml web/te-benchmark-um/config/sdorm.xml
  41. fi
  42. rm -f rtdcf/*.d rtdcf/*.o
  43. rm -f *.cntrl
  44. rm -f tmp/*.sess
  45. if [ ! -d tmp ]; then
  46. mkdir tmp
  47. fi
  48. chmod 700 ffead-cpp*
  49. chmod 700 resources/*.sh
  50. chmod 700 tests/*
  51. chmod 700 rtdcf/*
  52. if [ $1 = "emb" ]
  53. then
  54. ./ffead-cpp $FFEAD_CPP_PATH
  55. fi
  56. if [ $1 = "apache" ]
  57. then
  58. sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/sdorm.xml
  59. sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/cache.xml
  60. apachectl -D FOREGROUND
  61. fi
  62. if [ $1 = "nginx" ]
  63. then
  64. sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/sdorm.xml
  65. sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark-um/config/cache.xml
  66. nginx -g 'daemon off;'
  67. fi
  68. wait