Browse Source

ffead-cpp version 3.0 (#4562)

* Fixed failing builds

* Added support for building ffead-cpp-3.0

* ffead-cpp version 3.0

* Fixed issues with cached tests

* Fixed failing cache tests

* Fixed cached tests Attempt 4

* Fixed cached tests Attempt 5
Sumeet Chhetri 6 years ago
parent
commit
fed6fadce5
33 changed files with 352 additions and 204 deletions
  1. 14 7
      frameworks/C++/ffead-cpp/benchmark_config.json
  2. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-apache-memcached.dockerfile
  3. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-apache-mongo.dockerfile
  4. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-apache-mysql.dockerfile
  5. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-apache-postgresql.dockerfile
  6. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-apache-redis.dockerfile
  7. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-memcached.dockerfile
  8. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile
  9. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-memcached.dockerfile
  10. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-mongo.dockerfile
  11. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-mysql.dockerfile
  12. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-postgresql.dockerfile
  13. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-nginx-redis.dockerfile
  14. 3 3
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile
  15. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp-redis.dockerfile
  16. 2 2
      frameworks/C++/ffead-cpp/ffead-cpp.dockerfile
  17. 6 3
      frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh
  18. 98 0
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework-forsql.sh
  19. 39 39
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh
  20. 15 15
      frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh
  21. 11 11
      frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh
  22. 6 15
      frameworks/C++/ffead-cpp/run_ffead.sh
  23. 3 3
      frameworks/C++/ffead-cpp/server.sh
  24. 10 0
      frameworks/C++/ffead-cpp/te-benchmark/CMakeLists.txt
  25. 1 1
      frameworks/C++/ffead-cpp/te-benchmark/config/sdorm.xml
  26. 1 1
      frameworks/C++/ffead-cpp/te-benchmark/config/sdormmongo.xml
  27. 1 1
      frameworks/C++/ffead-cpp/te-benchmark/config/sdormmysql.xml
  28. 1 1
      frameworks/C++/ffead-cpp/te-benchmark/config/sdormpostgresql.xml
  29. 1 0
      frameworks/C++/ffead-cpp/te-benchmark/include/TeBkRestController.h
  30. 21 15
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortuneTemplate.cpp
  31. 82 55
      frameworks/C++/ffead-cpp/te-benchmark/src/TeBkRestController.cpp
  32. 1 1
      frameworks/C++/ffead-cpp/te-benchmark/src/autotools/Makefile.am
  33. 5 0
      toolset/benchmark/benchmarker.py

+ 14 - 7
frameworks/C++/ffead-cpp/benchmark_config.json

@@ -215,7 +215,8 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-mongo-redis",
 			"display_name": "ffead-cpp-mongo-redis",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		},
 		},
 		"nginx-redis": {
 		"nginx-redis": {
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
@@ -233,7 +234,8 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-nginx-mongo-redis",
 			"display_name": "ffead-cpp-nginx-mongo-redis",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		},
 		},
 		"apache-redis": {
 		"apache-redis": {
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
@@ -251,7 +253,8 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-apache-mongo-redis",
 			"display_name": "ffead-cpp-apache-mongo-redis",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		},
 		},
 		"memcached": {
 		"memcached": {
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
@@ -269,7 +272,8 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-mongo-memcached",
 			"display_name": "ffead-cpp-mongo-memcached",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		},
 		},
 		"nginx-memcached": {
 		"nginx-memcached": {
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
@@ -287,7 +291,8 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-nginx-mongo-memcached",
 			"display_name": "ffead-cpp-nginx-mongo-memcached",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		},
 		},
 		"apache-memcached": {
 		"apache-memcached": {
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
 			"cached_query_url": "/te-benchmark/cached-worlds?count=",
@@ -305,7 +310,9 @@
 			"database_os": "Linux",
 			"database_os": "Linux",
 			"display_name": "ffead-cpp-apache-mongo-memcached",
 			"display_name": "ffead-cpp-apache-mongo-memcached",
 			"notes": "",
 			"notes": "",
-			"versus": ""
+			"versus": "",
+			"wait_before_sending_requests": 10
 		}
 		}
 	}]
 	}]
-}
+}
+

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-apache-memcached.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-apache-mongo.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-apache-mysql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-apache-postgresql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-apache-redis.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-memcached.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-nginx-memcached.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-nginx-mongo.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-nginx-mysql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-nginx-postgresql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-nginx-redis.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 3 - 3
frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs
@@ -16,7 +16,7 @@ RUN ./install_ffead-cpp-dependencies.sh
 
 
 WORKDIR /
 WORKDIR /
 
 
-RUN ./install_ffead-cpp-framework.sh
+RUN ./install_ffead-cpp-framework-forsql.sh
 
 
 WORKDIR /
 WORKDIR /
 
 

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp-redis.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 2 - 2
frameworks/C++/ffead-cpp/ffead-cpp.dockerfile

@@ -1,7 +1,7 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
 ENV IROOT=/installs
 ENV IROOT=/installs
-ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-2.0
+ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-3.0
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 ENV PATH=${FFEAD_CPP_PATH}:${PATH}
 
 
 RUN mkdir /installs
 RUN mkdir /installs

+ 6 - 3
frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh

@@ -3,7 +3,10 @@
 cd $IROOT
 cd $IROOT
 
 
 apt update -yqq
 apt update -yqq
-apt install -yqq unzip uuid-dev odbc-postgresql unixodbc unixodbc-dev apache2 apache2-dev libapr1-dev libaprutil1-dev memcached libmemcached-dev redis-server libssl-dev zlib1g-dev
+apt install -yqq autoconf-archive unzip uuid-dev odbc-postgresql unixodbc unixodbc-dev apache2 apache2-dev libapr1-dev libaprutil1-dev memcached libmemcached-dev redis-server libssl-dev zlib1g-dev cmake make
+
+#redis will not start correctly on bionic with this config
+sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf
 
 
 service apache2 stop
 service apache2 stop
 service memcached stop
 service memcached stop
@@ -22,7 +25,7 @@ mysql-connector-odbc-5.3.11-linux-ubuntu16.04-x86-64bit/bin/myodbc-installer -d
 wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.0/mongo-c-driver-1.4.0.tar.gz
 wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.0/mongo-c-driver-1.4.0.tar.gz
 tar xf mongo-c-driver-1.4.0.tar.gz
 tar xf mongo-c-driver-1.4.0.tar.gz
 cd mongo-c-driver-1.4.0/ && \
 cd mongo-c-driver-1.4.0/ && \
-    ./configure --prefix=${IROOT} --libdir=${IROOT} --disable-automatic-init-and-cleanup && \
+    ./configure --disable-automatic-init-and-cleanup && \
     make && make install
     make && make install
 
 
 
 
@@ -30,5 +33,5 @@ wget https://github.com/redis/hiredis/archive/v0.13.3.tar.gz
 tar xvf v0.13.3.tar.gz
 tar xvf v0.13.3.tar.gz
 cd hiredis-0.13.3/
 cd hiredis-0.13.3/
 make
 make
-PREFIX=${IROOT}/ make install
+PREFIX=/usr make install
 	
 	

+ 98 - 0
frameworks/C++/ffead-cpp/install_ffead-cpp-framework-forsql.sh

@@ -0,0 +1,98 @@
+#!/bin/bash
+
+#From https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/C%2B%2B/ulib/setup_json.sh
+MAX_THREADS=$(( 3 * `nproc` / 2 ))
+
+WRIT_THREADS=$(( $MAX_THREADS / 3 ))
+SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
+
+cd $IROOT
+
+wget -q https://github.com/efficient/libcuckoo/archive/master.zip
+unzip master.zip
+rm -f master.zip
+cd libcuckoo-master
+cmake -DCMAKE_INSTALL_PREFIX=/usr .
+make install
+cd $IROOT
+rm -rf libcuckoo-master
+
+cd $IROOT
+
+wget -q https://github.com/sumeetchhetri/ffead-cpp/archive/master.zip
+unzip master.zip
+mv ffead-cpp-master ffead-cpp-src
+mv ${TROOT}/ffead-cpp-src ffead-cpp-src
+cd ffead-cpp-src/
+
+chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
+rm -rf web/te-benchmark
+cp -f ${TROOT}/server.sh script/
+cp -rf ${TROOT}/te-benchmark web/
+sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop
+sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
+sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
+
+rm -rf web/default web/oauthApp web/flexApp web/markers
+
+sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmongo.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmysql.xml
+sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
+sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini
+sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/default)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/flexApp)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/oauthApp)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/markers)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/default/libdefault${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/flexApp/libflexApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/oauthApp/liboauthApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/markers/libmarkers${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|web/default/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/flexApp/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/oauthApp/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/markers/src/autotools/Makefile||g' configure.ac
+
+#./autogen.sh
+#./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib"
+#make install
+cmake -DMOD_APACHE=on -DMOD_NGINX=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=on .
+#make install -j4
+
+cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
+cp resources/sample-odbc.ini ${IROOT}/odbc.ini
+
+cd ${IROOT}/ffead-cpp-src/
+
+cd ${IROOT}/ffead-cpp-src/
+#Build for sql now
+cp -f web/te-benchmark/sql-src/TeBkWorldsql.h web/te-benchmark/include/TeBkWorld.h
+cp -f web/te-benchmark/sql-src/TeBkWorldsql.cpp web/te-benchmark/src/TeBkWorld.cpp
+make install -j4
+cd ffead-cpp-3.0-bin
+chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
+./server.sh &
+while [ ! -f lib/libinter.so ]
+do
+	sleep 1
+done
+while [ ! -f lib/libdinter.so ]
+do
+	sleep 1
+done
+pkill ffead-cpp
+
+cd ${IROOT}/ffead-cpp-src/
+cp -rf ffead-cpp-3.0-bin ${IROOT}/ffead-cpp-3.0
+rm -rf ffead-cpp-3.0-bin
+
+cd ${IROOT}/ffead-cpp-3.0
+cp -f ${TROOT}/run_ffead.sh ./
+
+chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
+chmod 755 $FFEAD_CPP_PATH/*.sh
+rm -f $FFEAD_CPP_PATH/*.cntrl
+rm -f $FFEAD_CPP_PATH/tmp/*.sess
+#cache related dockerfiles will add the cache.xml accordingly whenever needed
+rm -f web/te-benchmark/config/cache.xml

+ 39 - 39
frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh

@@ -8,9 +8,21 @@ SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
 
 
 cd $IROOT
 cd $IROOT
 
 
-wget -q https://github.com/sumeetchhetri/ffead-cpp/archive/v2.2.zip
-unzip v2.2.zip
-mv ffead-cpp-2.2 ffead-cpp-src
+wget -q https://github.com/efficient/libcuckoo/archive/master.zip
+unzip master.zip
+rm -f master.zip
+cd libcuckoo-master
+cmake -DCMAKE_INSTALL_PREFIX=/usr .
+make install
+cd $IROOT
+rm -rf libcuckoo-master
+
+cd $IROOT
+
+wget -q https://github.com/sumeetchhetri/ffead-cpp/archive/master.zip
+unzip master.zip
+mv ffead-cpp-master ffead-cpp-src
+mv ${TROOT}/ffead-cpp-src ffead-cpp-src
 cd ffead-cpp-src/
 cd ffead-cpp-src/
 
 
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
@@ -21,10 +33,6 @@ sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop
 sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
 sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
 sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
 sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
 
 
-./autogen.sh
-./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib"
-make install
-
 rm -rf web/default web/oauthApp web/flexApp web/markers
 rm -rf web/default web/oauthApp web/flexApp web/markers
 
 
 sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
 sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
@@ -33,36 +41,32 @@ sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmysql.xml
 sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
 sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini
 sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/default)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/flexApp)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/oauthApp)||g' CMakeLists.txt
+sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/markers)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/default/libdefault${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/flexApp/libflexApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/oauthApp/liboauthApp${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|install(FILES ${PROJECT_SOURCE_DIR}/web/markers/libmarkers${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
+sed -i 's|web/default/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/flexApp/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/oauthApp/src/autotools/Makefile||g' configure.ac
+sed -i 's|web/markers/src/autotools/Makefile||g' configure.ac
+
+#./autogen.sh
+#./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib"
+#make install
+cmake -DMOD_APACHE=on -DMOD_NGINX=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=on .
+#make install -j4
 
 
 cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
 cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
 cp resources/sample-odbc.ini ${IROOT}/odbc.ini
 cp resources/sample-odbc.ini ${IROOT}/odbc.ini
 
 
 cd ${IROOT}/ffead-cpp-src/
 cd ${IROOT}/ffead-cpp-src/
 
 
-#Build for mongodb first
-cp -f web/te-benchmark/sql-src/TeBkWorldmongo.h web/te-benchmark/include/TeBkWorld.h
-cp -f web/te-benchmark/sql-src/TeBkWorldmongo.cpp web/te-benchmark/src/TeBkWorld.cpp
-make build-apps
-cd ffead-cpp-2.0-bin
-chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
-./server.sh &
-while [ ! -f lib/libinter.so ]
-do
-	sleep 1
-done
-while [ ! -f lib/libdinter.so ]
-do
-	sleep 1
-done
-pkill CHS
-mv lib ../lib-mongo
-
-cd ${IROOT}/ffead-cpp-src/
-#Build for sql now
-cp -f web/te-benchmark/sql-src/TeBkWorldsql.h web/te-benchmark/include/TeBkWorld.h
-cp -f web/te-benchmark/sql-src/TeBkWorldsql.cpp web/te-benchmark/src/TeBkWorld.cpp
-make build-apps
-cd ffead-cpp-2.0-bin
+make install -j4
+cd ffead-cpp-3.0-bin
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 ./server.sh &
 ./server.sh &
 while [ ! -f lib/libinter.so ]
 while [ ! -f lib/libinter.so ]
@@ -73,17 +77,13 @@ while [ ! -f lib/libdinter.so ]
 do
 do
 	sleep 1
 	sleep 1
 done
 done
-pkill CHS
-mv lib ../lib-sql
+pkill ffead-cpp
 
 
 cd ${IROOT}/ffead-cpp-src/
 cd ${IROOT}/ffead-cpp-src/
-cp -rf ffead-cpp-2.0-bin ${IROOT}/ffead-cpp-2.0
-cp -rf lib-mongo ${IROOT}/ffead-cpp-2.0/
-cp -rf lib-sql ${IROOT}/ffead-cpp-2.0/
-cp -rf lib-mongo ${IROOT}/ffead-cpp-2.0/lib
-rm -rf ffead-cpp-2.0-bin
+cp -rf ffead-cpp-3.0-bin ${IROOT}/ffead-cpp-3.0
+rm -rf ffead-cpp-3.0-bin
 
 
-cd ${IROOT}/ffead-cpp-2.0
+cd ${IROOT}/ffead-cpp-3.0
 cp -f ${TROOT}/run_ffead.sh ./
 cp -f ${TROOT}/run_ffead.sh ./
 
 
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
 chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh

+ 15 - 15
frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh

@@ -2,7 +2,7 @@
 
 
 cd $IROOT
 cd $IROOT
 
 
-#chown -R www-data:www-data ffead-cpp-2.0
+#chown -R www-data:www-data ffead-cpp-3.0
 
 
 #wget -q https://archive.apache.org/dist/httpd/httpd-2.4.25.tar.gz
 #wget -q https://archive.apache.org/dist/httpd/httpd-2.4.25.tar.gz
 #wget -q https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
 #wget -q https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
@@ -23,28 +23,28 @@ cd $IROOT
 #make install
 #make install
 #cd ${IROOT}
 #cd ${IROOT}
 
 
-sed -i 's|#define PACKAGE_BUGREPORT "[email protected]"| |g' ${IROOT}/ffead-cpp-2.0/include/AppDefines.h
-sed -i 's|#define PACKAGE_NAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-2.0/include/AppDefines.h
-sed -i 's|#define PACKAGE_STRING "ffead-cpp 2.0"| |g' ${IROOT}/ffead-cpp-2.0/include/AppDefines.h
-sed -i 's|#define PACKAGE_TARNAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-2.0/include/AppDefines.h
-sed -i 's|#define PACKAGE_VERSION "2.0"| |g' ${IROOT}/ffead-cpp-2.0/include/AppDefines.h
+sed -i 's|#define PACKAGE_BUGREPORT "[email protected]"| |g' ${IROOT}/ffead-cpp-3.0/include/AppDefines.h
+sed -i 's|#define PACKAGE_NAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-3.0/include/AppDefines.h
+sed -i 's|#define PACKAGE_STRING "ffead-cpp 2.0"| |g' ${IROOT}/ffead-cpp-3.0/include/AppDefines.h
+sed -i 's|#define PACKAGE_TARNAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-3.0/include/AppDefines.h
+sed -i 's|#define PACKAGE_VERSION "2.0"| |g' ${IROOT}/ffead-cpp-3.0/include/AppDefines.h
 
 
-cd ${IROOT}/ffead-cpp-src/modules/apache_mod_ffeadcpp/
-g++ -fpic -DSHARED_MODULE -fpermissive -std=gnu++11 -I"/usr/include/apache2" -I"/usr/include/apr-1.0" -I"${IROOT}/ffead-cpp-2.0/include/" -I"${IROOT}/include" -I"${IROOT}/include/libbson-1.0/" -I"${IROOT}/include/libmongoc-1.0" mod_ffeadcpp.cpp -L"${IROOT}/ffead-cpp-2.0/lib" -L"${IROOT}" -L"${IROOT}/lib" -lffead_common -lffead_framework -ldl -lcrypto -lssl -lhiredis -lmemcachedutil -c mod_ffeadcpp.cpp
-g++ -shared -o mod_ffeadcpp.so mod_ffeadcpp.o -L"${IROOT}/ffead-cpp-2.0/lib" -L"${IROOT}" -L"${IROOT}/lib" -lffead_common -lffead_framework -ldl -lcrypto -lssl -lapr-1 -laprutil-1 -lstdc++ -lhiredis -lmemcachedutil
-apxs -i -n 'ffead_cpp' mod_ffeadcpp.so
-cd -
+#cd ${IROOT}/ffead-cpp-src/modules/apache_mod_ffeadcpp/
+#g++ -fpic -DSHARED_MODULE -fpermissive -std=gnu++11 -I"/usr/include/apache2" -I"/usr/include/apr-1.0" -I"${IROOT}/ffead-cpp-3.0/include/" -I"${IROOT}/include" -I"${IROOT}/include/libbson-1.0/" -I"${IROOT}/include/libmongoc-1.0" mod_ffeadcpp.cpp -L"${IROOT}/ffead-cpp-3.0/lib" -L"${IROOT}" -L"${IROOT}/lib" -lffead_common -lffead_framework -ldl -lcrypto -lssl -lhiredis -lmemcachedutil -c mod_ffeadcpp.cpp
+#g++ -shared -o mod_ffeadcpplib.so mod_ffeadcpp.o -L"${IROOT}/ffead-cpp-3.0/lib" -L"${IROOT}" -L"${IROOT}/lib" -lffead_common -lffead_framework -ldl -lcrypto -lssl -lapr-1 -laprutil-1 -lstdc++ -lhiredis -lmemcachedutil
+#apxs -i -n 'ffead_cpp_module' mod_ffeadcpplib.so
+#cd -
 
 
-FFEADROOT=${IROOT}/ffead-cpp-2.0
+FFEADROOT=${IROOT}/ffead-cpp-3.0
 ETROOT=${FFEADROOT//\//\\/}
 ETROOT=${FFEADROOT//\//\\/}
 EIROOT=${IROOT//\//\\/}
 EIROOT=${IROOT//\//\\/}
 
 
 sed -i 's|Include ports.conf|#Include ports.conf|g' /etc/apache2/apache2.conf
 sed -i 's|Include ports.conf|#Include ports.conf|g' /etc/apache2/apache2.conf
-echo 'Include /etc/apache2/sites-enabled/ffead-site.conf' >> /etc/apache2/apache2.conf
+#echo 'Include /etc/apache2/sites-enabled/ffead-site.conf' >> /etc/apache2/apache2.conf
 
 
 bash -c 'cat <<EOL >> /etc/apache2/envvars
 bash -c 'cat <<EOL >> /etc/apache2/envvars
 export FFEAD_CPP_PATH='"${FFEADROOT}"'
 export FFEAD_CPP_PATH='"${FFEADROOT}"'
-export LD_LIBRARY_PATH='"${FFEADROOT}"'/lib:'"${IROOT}"':'"${IROOT}"'/lib:$LD_LIBRARY_PATH/
+export LD_LIBRARY_PATH='"${FFEADROOT}"'/lib:'"${IROOT}"':'"${IROOT}"'/lib:/usr/local/lib:$LD_LIBRARY_PATH/
 export ODBCINI='"$IROOT"'/odbc.ini
 export ODBCINI='"$IROOT"'/odbc.ini
 export ODBCSYSINI='"$IROOT"' 
 export ODBCSYSINI='"$IROOT"' 
 EOL'
 EOL'
@@ -63,7 +63,7 @@ EOL'
 
 
 mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/ffead-site.conf
 mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/ffead-site.conf
 bash -c 'cat > /etc/apache2/sites-enabled/ffead-site.conf <<EOL
 bash -c 'cat > /etc/apache2/sites-enabled/ffead-site.conf <<EOL
-LoadModule ffead_cpp_module /usr/lib/apache2/modules/mod_ffeadcpp.so
+LoadModule ffead_cpp_module /usr/lib/apache2/modules/mod_ffeadcpplib.so
 Listen 8080
 Listen 8080
 FFEAD_CPP_PATH '"${FFEADROOT}"'
 FFEAD_CPP_PATH '"${FFEADROOT}"'
 <VirtualHost *:8080>
 <VirtualHost *:8080>

+ 11 - 11
frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh

@@ -2,18 +2,18 @@
 
 
 cd $IROOT
 cd $IROOT
 
 
-wget -q http://nginx.org/download/nginx-1.13.1.tar.gz
-tar xf nginx-1.13.1.tar.gz
+#wget -q http://nginx.org/download/nginx-1.13.1.tar.gz
+#tar xf nginx-1.13.1.tar.gz
 
 
-cd $IROOT/nginx-1.13.1
+#cd $IROOT/nginx-1.13.1
 
 
-./configure \
-    --prefix=${IROOT}/nginxfc \
-    --with-ld-opt="-lstdc++ -lhiredis -lmemcachedutil -L${IROOT}/ffead-cpp-2.0/lib -L${IROOT} -L${IROOT}/lib" \
-    --add-module="${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp" \
-    --with-cc-opt="-I${IROOT}/ffead-cpp-2.0/include -I${IROOT}/include -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -w -fpermissive -std=gnu++11"
-make
-make install
+#./configure \
+#    --prefix=${IROOT}/nginxfc \
+#    --with-ld-opt="-lstdc++ -L/usr/local/lib -L${IROOT}/ffead-cpp-3.0/lib -L${IROOT} -L${IROOT}/lib" \
+#    --add-module="${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp" \
+#    --with-cc-opt="-I${IROOT}/ffead-cpp-3.0/include -I${IROOT}/include -I${IROOT}/#include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -w -fpermissive -std=gnu++11"
+#make
+#make install
 
 
 cp ${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp/nginx.conf ${IROOT}/nginxfc/conf/
 cp ${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp/nginx.conf ${IROOT}/nginxfc/conf/
-sed -i 's|FFEAD_PATH|'${IROOT}/ffead-cpp-2.0'|g' ${IROOT}/nginxfc/conf/nginx.conf
+sed -i 's|FFEAD_PATH|'${IROOT}/ffead-cpp-3.0'|g' ${IROOT}/nginxfc/conf/nginx.conf

+ 6 - 15
frameworks/C++/ffead-cpp/run_ffead.sh

@@ -5,7 +5,7 @@ echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.local
 sysctl vm.overcommit_memory=1
 sysctl vm.overcommit_memory=1
 
 
 export PATH=${IROOT}/nginxfc/sbin:${PATH}
 export PATH=${IROOT}/nginxfc/sbin:${PATH}
-export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/lib:$LD_LIBRARY_PATH
 export ODBCINI=${IROOT}/odbc.ini
 export ODBCINI=${IROOT}/odbc.ini
 export ODBCSYSINI=${IROOT}
 export ODBCSYSINI=${IROOT}
 
 
@@ -19,45 +19,36 @@ service redis-server stop
 service apache2 stop
 service apache2 stop
 service memcached stop
 service memcached stop
 
 
+rm -f /tmp/cache.lock
 rm -f web/te-benchmark/config/cache.xml
 rm -f web/te-benchmark/config/cache.xml
 
 
 if [ $2 = "redis" ]
 if [ $2 = "redis" ]
 then
 then
 	service redis-server start
 	service redis-server start
-	rm -rf lib
 	cp -f web/te-benchmark/config/cacheredis.xml web/te-benchmark/config/cache.xml
 	cp -f web/te-benchmark/config/cacheredis.xml web/te-benchmark/config/cache.xml
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
-	cp -rf lib-mongo lib
 fi
 fi
 
 
 if [ $2 = "memcached" ]
 if [ $2 = "memcached" ]
 then
 then
 	service memcached start
 	service memcached start
-	rm -rf lib
 	cp -f web/te-benchmark/config/cachememcached.xml web/te-benchmark/config/cache.xml
 	cp -f web/te-benchmark/config/cachememcached.xml web/te-benchmark/config/cache.xml
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
-	cp -rf lib-mongo lib
 fi
 fi
 
 
 if [ $2 = "mongo" ]
 if [ $2 = "mongo" ]
 then
 then
-	rm -rf lib
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
 	cp -f web/te-benchmark/config/sdormmongo.xml web/te-benchmark/config/sdorm.xml
-	cp -rf lib-mongo lib
 fi
 fi
 
 
 if [ $2 = "mysql" ]
 if [ $2 = "mysql" ]
 then
 then
-	rm -rf lib
 	cp -f web/te-benchmark/config/sdormmysql.xml web/te-benchmark/config/sdorm.xml
 	cp -f web/te-benchmark/config/sdormmysql.xml web/te-benchmark/config/sdorm.xml
-	cp -rf lib-sql lib
 fi
 fi
 
 
 if [ $2 = "postgresql" ]
 if [ $2 = "postgresql" ]
 then
 then
-	rm -rf lib
 	cp -f web/te-benchmark/config/sdormpostgresql.xml web/te-benchmark/config/sdorm.xml
 	cp -f web/te-benchmark/config/sdormpostgresql.xml web/te-benchmark/config/sdorm.xml
-	cp -rf lib-sql lib
 fi
 fi
 
 
 rm -f rtdcf/*.d rtdcf/*.o 
 rm -f rtdcf/*.d rtdcf/*.o 
@@ -66,26 +57,26 @@ rm -f tmp/*.sess
 if [ ! -d tmp ]; then
 if [ ! -d tmp ]; then
 mkdir tmp
 mkdir tmp
 fi
 fi
-chmod 700 CHS*
+chmod 700 ffead-cpp*
 chmod 700 resources/*.sh
 chmod 700 resources/*.sh
 chmod 700 tests/*
 chmod 700 tests/*
 chmod 700 rtdcf/*
 chmod 700 rtdcf/*
 
 
 if [ $1 = "emb" ]
 if [ $1 = "emb" ]
 then
 then
-	./CHS $FFEAD_CPP_PATH
+	./ffead-cpp $FFEAD_CPP_PATH
 fi
 fi
 
 
 if [ $1 = "apache" ]
 if [ $1 = "apache" ]
 then
 then
-	sed -i 's|<pool-size>20</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
+	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
 	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
 	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
 	apachectl -D FOREGROUND
 	apachectl -D FOREGROUND
 fi
 fi
 
 
 if [ $1 = "nginx" ]
 if [ $1 = "nginx" ]
 then
 then
-	sed -i 's|<pool-size>20</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
+	sed -i 's|<pool-size>30</pool-size>|<pool-size>3</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/sdorm.xml
 	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
 	sed -i 's|<pool-size>10</pool-size>|<pool-size>2</pool-size>|g' $FFEAD_CPP_PATH/web/te-benchmark/config/cache.xml
 	nginx -g 'daemon off;'
 	nginx -g 'daemon off;'
 fi
 fi

+ 3 - 3
frameworks/C++/ffead-cpp/server.sh

@@ -11,7 +11,7 @@ fi
 export ODBCINI=${IROOT}/odbc.ini
 export ODBCINI=${IROOT}/odbc.ini
 export ODBCSYSINI=${IROOT}
 export ODBCSYSINI=${IROOT}
 echo $FFEAD_CPP_PATH
 echo $FFEAD_CPP_PATH
-export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:$FFEAD_CPP_PATH/lib:/usr/local/lib:$LD_LIBRARY_PATH
 echo $LD_LIBRARY_PATH
 echo $LD_LIBRARY_PATH
 export PATH=$FFEAD_CPP_PATH/lib:$PATH
 export PATH=$FFEAD_CPP_PATH/lib:$PATH
 echo $PATH
 echo $PATH
@@ -21,10 +21,10 @@ rm -f $FFEAD_CPP_PATH/tmp/*.sess
 if [ ! -d tmp ]; then
 if [ ! -d tmp ]; then
 mkdir tmp
 mkdir tmp
 fi
 fi
-chmod 700 $FFEAD_CPP_PATH/CHS*
+chmod 700 $FFEAD_CPP_PATH/ffead-cpp
 chmod 700 $FFEAD_CPP_PATH/resources/*.sh
 chmod 700 $FFEAD_CPP_PATH/resources/*.sh
 chmod 700 $FFEAD_CPP_PATH/tests/*
 chmod 700 $FFEAD_CPP_PATH/tests/*
 chmod 700 $FFEAD_CPP_PATH/rtdcf/*
 chmod 700 $FFEAD_CPP_PATH/rtdcf/*
 #chmod 700 $FFEAD_CPP_PATH/rtdcf/autotools/*
 #chmod 700 $FFEAD_CPP_PATH/rtdcf/autotools/*
 #/usr/sbin/setenforce 0
 #/usr/sbin/setenforce 0
-./CHS $FFEAD_CPP_PATH > ffead.log 2>&1
+./ffead-cpp $FFEAD_CPP_PATH > ffead.log 2>&1

+ 10 - 0
frameworks/C++/ffead-cpp/te-benchmark/CMakeLists.txt

@@ -0,0 +1,10 @@
+
+file(GLOB sources
+    "include/*.h"
+    "src/*.cpp"
+)
+
+include_directories("${CMAKE_SOURCE_DIR}/web/te-benchmark/include")
+add_library(te_benchmark SHARED ${sources})
+set_property(TARGET te_benchmark PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(te_benchmark ffead-modules ffead-framework ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB})

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/sdorm.xml

@@ -8,7 +8,7 @@
 					<databaseName>hello_world</databaseName>
 					<databaseName>hello_world</databaseName>
 				</node>
 				</node>
 			</nodes>
 			</nodes>
-			<pool-size>20</pool-size>
+			<pool-size>30</pool-size>
 			<name>MongoDB-DSN</name>
 			<name>MongoDB-DSN</name>
 			<type>mongo</type>
 			<type>mongo</type>
 		</config>
 		</config>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/sdormmongo.xml

@@ -8,7 +8,7 @@
 					<databaseName>hello_world</databaseName>
 					<databaseName>hello_world</databaseName>
 				</node>
 				</node>
 			</nodes>
 			</nodes>
-			<pool-size>20</pool-size>
+			<pool-size>30</pool-size>
 			<name>MongoDB-DSN</name>
 			<name>MongoDB-DSN</name>
 			<type>mongo</type>
 			<type>mongo</type>
 		</config>
 		</config>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/sdormmysql.xml

@@ -8,7 +8,7 @@
 					<password>benchmarkdbpass</password>
 					<password>benchmarkdbpass</password>
 				</node>
 				</node>
 			</nodes>
 			</nodes>
-			<pool-size>20</pool-size>
+			<pool-size>30</pool-size>
 			<name>MySQL-DSN</name>
 			<name>MySQL-DSN</name>
 			<type>sql</type>
 			<type>sql</type>
 			<dialect>MySQLMyISAMDialect</dialect>
 			<dialect>MySQLMyISAMDialect</dialect>

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/config/sdormpostgresql.xml

@@ -8,7 +8,7 @@
 					<password>benchmarkdbpass</password>
 					<password>benchmarkdbpass</password>
 				</node>
 				</node>
 			</nodes>
 			</nodes>
-			<pool-size>20</pool-size>
+			<pool-size>30</pool-size>
 			<name>PostgreSQL-DSN</name>
 			<name>PostgreSQL-DSN</name>
 			<type>sql</type>
 			<type>sql</type>
 			<dialect>PostgresDialect</dialect>
 			<dialect>PostgresDialect</dialect>

+ 1 - 0
frameworks/C++/ffead-cpp/te-benchmark/include/TeBkRestController.h

@@ -14,6 +14,7 @@
 #include "DataSourceManager.h"
 #include "DataSourceManager.h"
 #include <stdlib.h>
 #include <stdlib.h>
 #include "CacheManager.h"
 #include "CacheManager.h"
+#include "Thread.h"
 
 
 
 
 #pragma @RestController path="/"
 #pragma @RestController path="/"

+ 21 - 15
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkFortuneTemplate.cpp

@@ -14,21 +14,27 @@ TeBkFortuneTemplate::~TeBkFortuneTemplate() {
 void TeBkFortuneTemplate::getContext(HttpRequest* request, Context* context)
 void TeBkFortuneTemplate::getContext(HttpRequest* request, Context* context)
 {
 {
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
-	std::vector<TeBkFortune> flst = sqli->getAll<TeBkFortune>();
-	for(int i=0;i<(int)flst.size();i++)
-	{
-		std::string nm = flst.at(i).getMessage();
-		CryptoHandler::sanitizeHtml(nm);
-		flst.at(i).setMessage(nm);
-	}
 
 
-	TeBkFortune nf;
-	nf.setId(0);
-	nf.setMessage("Additional fortune added at request time.");
-	flst.push_back(nf);
-	std::sort (flst.begin(), flst.end());
-	delete sqli;
+	try {
+		std::vector<TeBkFortune> flst = sqli->getAll<TeBkFortune>();
+		for(int i=0;i<(int)flst.size();i++)
+		{
+			std::string nm = flst.at(i).getMessage();
+			CryptoHandler::sanitizeHtml(nm);
+			flst.at(i).setMessage(nm);
+		}
+
+		TeBkFortune nf;
+		nf.setId(0);
+		nf.setMessage("Additional fortune added at request time.");
+		flst.push_back(nf);
+		std::sort (flst.begin(), flst.end());
+		delete sqli;
 
 
-	GenericObject& fortunes = (*context)["fortunes"];
-	fortunes << flst;
+		context->insert(std::pair<std::string, GenericObject>("fortunes", GenericObject()));
+		context->find("fortunes")->second << flst;
+	} catch(...) {
+		delete sqli;
+		throw;
+	}
 }
 }

+ 82 - 55
frameworks/C++/ffead-cpp/te-benchmark/src/TeBkRestController.cpp

@@ -24,9 +24,14 @@ TeBkWorld TeBkRestController::db() {
 	int rid = rand() % 10000 + 1;
 	int rid = rand() % 10000 + 1;
 	GenericObject id;
 	GenericObject id;
 	id << rid;
 	id << rid;
-	TeBkWorld w = sqli->get<TeBkWorld>(id);
-	delete sqli;
-	return w;
+	try {
+		TeBkWorld w = sqli->get<TeBkWorld>(id);
+		delete sqli;
+		return w;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
+	}
 }
 }
 
 
 std::vector<TeBkWorld> TeBkRestController::queries(std::string queries) {
 std::vector<TeBkWorld> TeBkRestController::queries(std::string queries) {
@@ -34,25 +39,30 @@ std::vector<TeBkWorld> TeBkRestController::queries(std::string queries) {
 	int queryCount = 1;
 	int queryCount = 1;
 	try {
 	try {
 		queryCount = CastUtil::lexical_cast<int>(queries);
 		queryCount = CastUtil::lexical_cast<int>(queries);
-	} catch(...) {
+	} catch(const std::exception& e) {
 	}
 	}
 	if(queryCount<1)queryCount=1;
 	if(queryCount<1)queryCount=1;
 	else if(queryCount>500)queryCount=500;
 	else if(queryCount>500)queryCount=500;
 
 
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 
 
-	std::string tbName = "world";
-	sqli->startSession(&tbName);
-	for (int c = 0; c < queryCount; ++c) {
-		int rid = rand() % 10000 + 1;
-		GenericObject id;
-		id << rid;
-		TeBkWorld w = sqli->get<TeBkWorld>(id);
-		wlst.push_back(w);
+	try {
+		std::string tbName = "world";
+		sqli->startSession(&tbName);
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			GenericObject id;
+			id << rid;
+			TeBkWorld w = sqli->get<TeBkWorld>(id);
+			wlst.push_back(w);
+		}
+		sqli->endSession();
+		delete sqli;
+		return wlst;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
 	}
 	}
-	sqli->endSession();
-	delete sqli;
-	return wlst;
 }
 }
 
 
 std::vector<TeBkWorld> TeBkRestController::updates(std::string queries) {
 std::vector<TeBkWorld> TeBkRestController::updates(std::string queries) {
@@ -60,36 +70,40 @@ std::vector<TeBkWorld> TeBkRestController::updates(std::string queries) {
 	int queryCount = 1;
 	int queryCount = 1;
 	try {
 	try {
 		queryCount = CastUtil::lexical_cast<int>(queries);
 		queryCount = CastUtil::lexical_cast<int>(queries);
-	} catch(...) {
+	} catch(const std::exception& e) {
 	}
 	}
 	if(queryCount<1)queryCount=1;
 	if(queryCount<1)queryCount=1;
 	else if(queryCount>500)queryCount=500;
 	else if(queryCount>500)queryCount=500;
 
 
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 
 
-	std::string tbName = "world";
-	sqli->startSession(&tbName);
-	for (int c = 0; c < queryCount; ++c) {
-		int rid = rand() % 10000 + 1;
-		GenericObject id;
-		id << rid;
-		TeBkWorld w = sqli->get<TeBkWorld>(id);
-		int newRandomNumber = rand() % 10000 + 1;
-		if(w.getRandomNumber() == newRandomNumber) {
-			newRandomNumber -= 1;
+	try {
+		std::string tbName = "world";
+		sqli->startSession(&tbName);
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			GenericObject id;
+			id << rid;
+			TeBkWorld w = sqli->get<TeBkWorld>(id);
+			int newRandomNumber = rand() % 10000 + 1;
+			if(w.getRandomNumber() == newRandomNumber) {
+				newRandomNumber -= 1;
+			}
+			w.setRandomNumber(newRandomNumber);
+			wlst.push_back(w);
 		}
 		}
-		w.setRandomNumber(newRandomNumber);
-		wlst.push_back(w);
-	}
 
 
-	sqli->startTransaction();
-	sqli->bulkUpdate<TeBkWorld>(wlst);
-	sqli->commit();
+		sqli->startTransaction();
+		sqli->bulkUpdate<TeBkWorld>(wlst);
+		sqli->commit();
 
 
-	sqli->endSession();
-
-	delete sqli;
-	return wlst;
+		sqli->endSession();
+		delete sqli;
+		return wlst;
+	} catch(const std::exception& e) {
+		delete sqli;
+		throw e;
+	}
 }
 }
 
 
 std::string TeBkRestController::plaintext() {
 std::string TeBkRestController::plaintext() {
@@ -99,37 +113,50 @@ std::string TeBkRestController::plaintext() {
 void TeBkRestController::updateCache() {
 void TeBkRestController::updateCache() {
 	CacheInterface* cchi = CacheManager::getImpl();
 	CacheInterface* cchi = CacheManager::getImpl();
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
 	DataSourceInterface* sqli = DataSourceManager::getImpl();
-	std::string tbName = "world";
-	sqli->startSession(&tbName);
-	for (int c = 1; c <= 10000; ++c) {
-		GenericObject id;
-		id << c;
-		TeBkWorld w = sqli->get<TeBkWorld>(id);
-		cchi->setO(CastUtil::lexical_cast<std::string>(c), w);
+
+	try {
+		std::string tbName = "world";
+		sqli->startSession(&tbName);
+		std::vector<TeBkWorld> wlist = sqli->getAll<TeBkWorld>();
+		sqli->endSession();
+		for (int c = 0; c < (int)wlist.size(); ++c) {
+			TeBkWorld& w = wlist.at(c);
+			cchi->setO(CastUtil::lexical_cast<std::string>(w.getId()), w);
+		}
+		delete sqli;
+		delete cchi;
+	} catch(const std::exception& e) {
+		delete sqli;
+		delete cchi;
+		throw e;
 	}
 	}
-	sqli->endSession();
-	delete sqli;
-	delete cchi;
 }
 }
 
 
 std::vector<TeBkWorld> TeBkRestController::cachedWorlds(std::string count) {
 std::vector<TeBkWorld> TeBkRestController::cachedWorlds(std::string count) {
 	int queryCount = 1;
 	int queryCount = 1;
 	try {
 	try {
 		queryCount = CastUtil::lexical_cast<int>(count);
 		queryCount = CastUtil::lexical_cast<int>(count);
-	} catch(...) {
+	} catch(const std::exception& e) {
 	}
 	}
 	if(queryCount<1)queryCount=1;
 	if(queryCount<1)queryCount=1;
 	else if(queryCount>500)queryCount=500;
 	else if(queryCount>500)queryCount=500;
 
 
 	CacheInterface* cchi = CacheManager::getImpl();
 	CacheInterface* cchi = CacheManager::getImpl();
-	std::vector<std::string> keys;
-	for (int c = 0; c < queryCount; ++c) {
-		int rid = rand() % 10000 + 1;
-		keys.push_back(CastUtil::lexical_cast<std::string>(rid));
-	}
 
 
-	std::vector<TeBkWorld> wlst = cchi->mgetO<TeBkWorld>(keys);
+	try {
+		std::vector<std::string> keys;
+		for (int c = 0; c < queryCount; ++c) {
+			int rid = rand() % 10000 + 1;
+			keys.push_back(CastUtil::lexical_cast<std::string>(rid));
+		}
+
+		std::vector<TeBkWorld> wlst = cchi->mgetO<TeBkWorld>(keys);
 
 
-	delete cchi;
-	return wlst;
+		delete cchi;
+		return wlst;
+	} catch(const std::exception& e) {
+		delete cchi;
+		throw e;
+	}
 }
 }
+

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark/src/autotools/Makefile.am

@@ -16,6 +16,6 @@ libte_benchmark_la_SOURCES = ../TeBkFortune.cpp \
 				../TeBkWorld.cpp
 				../TeBkWorld.cpp
 
 
 libte_benchmark_la_LDFLAGS = -no-undefined 
 libte_benchmark_la_LDFLAGS = -no-undefined 
-libte_benchmark_la_LIBADD = -L"${fprefix}/lib" -lffead_common -lffead_framework
+libte_benchmark_la_LIBADD = -L"${fprefix}/lib" -lffead-modules -lffead-framework
 
 
 #dist_noinst_SCRIPTS = autogen.sh
 #dist_noinst_SCRIPTS = autogen.sh

+ 5 - 0
toolset/benchmark/benchmarker.py

@@ -14,6 +14,7 @@ import shlex
 from pprint import pprint
 from pprint import pprint
 
 
 from colorama import Fore
 from colorama import Fore
+import numbers
 
 
 
 
 class Benchmarker:
 class Benchmarker:
@@ -154,6 +155,9 @@ class Benchmarker:
                     break
                     break
                 time.sleep(1)
                 time.sleep(1)
 
 
+            if hasattr(test, 'wait_before_sending_requests') and isinstance(test.wait_before_sending_requests, numbers.Integral) and test.wait_before_sending_requests > 0:
+                time.sleep(test.wait_before_sending_requests)
+
             if not accepting_requests:
             if not accepting_requests:
                 self.docker_helper.stop([container, database_container])
                 self.docker_helper.stop([container, database_container])
                 message = "ERROR: Framework is not accepting requests from client machine"
                 message = "ERROR: Framework is not accepting requests from client machine"
@@ -298,3 +302,4 @@ class Benchmarker:
         '''
         '''
         self.subprocess_handle.terminate()
         self.subprocess_handle.terminate()
         self.subprocess_handle.communicate()
         self.subprocess_handle.communicate()
+