Browse Source

Lithium: Switch back to gcc and benchmark number of sql connections. (#5903)

* Benchmark number of sql connections.

* Lithium: fix default test.

* Lithium: re-run travis.
Matthieu Garrigues 5 years ago
parent
commit
8ce8787653
26 changed files with 641 additions and 17 deletions
  1. 441 2
      frameworks/C++/lithium/benchmark_config.json
  2. 0 0
      frameworks/C++/lithium/compile_and_start_clang.sh
  3. 20 0
      frameworks/C++/lithium/compile_and_start_gcc.sh
  4. 8 0
      frameworks/C++/lithium/lithium-mysql-1.dockerfile
  5. 8 0
      frameworks/C++/lithium/lithium-mysql-10.dockerfile
  6. 8 0
      frameworks/C++/lithium/lithium-mysql-2.dockerfile
  7. 8 0
      frameworks/C++/lithium/lithium-mysql-3.dockerfile
  8. 8 0
      frameworks/C++/lithium/lithium-mysql-4.dockerfile
  9. 8 0
      frameworks/C++/lithium/lithium-mysql-5.dockerfile
  10. 8 0
      frameworks/C++/lithium/lithium-mysql-6.dockerfile
  11. 8 0
      frameworks/C++/lithium/lithium-mysql-7.dockerfile
  12. 8 0
      frameworks/C++/lithium/lithium-mysql-8.dockerfile
  13. 8 0
      frameworks/C++/lithium/lithium-mysql-9.dockerfile
  14. 8 0
      frameworks/C++/lithium/lithium-postgres-1.dockerfile
  15. 8 0
      frameworks/C++/lithium/lithium-postgres-10.dockerfile
  16. 8 0
      frameworks/C++/lithium/lithium-postgres-2.dockerfile
  17. 8 0
      frameworks/C++/lithium/lithium-postgres-3.dockerfile
  18. 8 0
      frameworks/C++/lithium/lithium-postgres-4.dockerfile
  19. 8 0
      frameworks/C++/lithium/lithium-postgres-5.dockerfile
  20. 8 0
      frameworks/C++/lithium/lithium-postgres-6.dockerfile
  21. 8 0
      frameworks/C++/lithium/lithium-postgres-7.dockerfile
  22. 8 0
      frameworks/C++/lithium/lithium-postgres-8.dockerfile
  23. 8 0
      frameworks/C++/lithium/lithium-postgres-9.dockerfile
  24. 2 2
      frameworks/C++/lithium/lithium-postgres.dockerfile
  25. 16 11
      frameworks/C++/lithium/lithium.cc
  26. 2 2
      frameworks/C++/lithium/lithium.dockerfile

+ 441 - 2
frameworks/C++/lithium/benchmark_config.json

@@ -25,8 +25,446 @@
         "notes": "",
         "notes": "",
         "versus": "None"
         "versus": "None"
       },
       },
+      "mysql-1": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-1",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-2": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-2",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-3": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-3",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-4": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-4",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-5": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-5",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-6": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-6",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-7": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-7",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-8": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-8",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-9": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-9",
+        "notes": "",
+        "versus": "None"
+      },
+      "mysql-10": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "mysql",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-mysql-10",
+        "notes": "",
+        "versus": "None"
+      },
       
       
-      "postgres": {
+      "postgres-1": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-1",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-2": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-2",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-3": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-3",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-4": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-4",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-5": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-5",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-6": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-6",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-7": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-7",
+        "notes": "",
+        "versus": "None"
+      },
+
+      "postgres-8": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-8",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-9": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-9",
+        "notes": "",
+        "versus": "None"
+      },
+      "postgres-10": {
         "json_url"       : "/json",
         "json_url"       : "/json",
         "db_url"         : "/db",
         "db_url"         : "/db",
         "query_url"      : "/queries?N=",
         "query_url"      : "/queries?N=",
@@ -45,10 +483,11 @@
         "webserver": "None",
         "webserver": "None",
         "os": "Linux",
         "os": "Linux",
         "database_os": "Linux",
         "database_os": "Linux",
-        "display_name": "Lithium-postgres",
+        "display_name": "Lithium-postgres-10",
         "notes": "",
         "notes": "",
         "versus": "None"
         "versus": "None"
       }
       }
+
     }
     }
   ]
   ]
 }
 }

+ 0 - 0
frameworks/C++/lithium/compile_and_start.sh → frameworks/C++/lithium/compile_and_start_clang.sh


+ 20 - 0
frameworks/C++/lithium/compile_and_start_gcc.sh

@@ -0,0 +1,20 @@
+#! /bin/sh
+
+DB_FLAG=$1
+N_SQL_CONNECTIONS=$2
+COMMIT=2ea53ab949627baeaaad77e7662da74f9a9d0a31
+
+if [ $DB_FLAG = "TFB_MYSQL" ]; then
+  CXX_FLAGS="-I /usr/include/mariadb  -lmariadbclient "
+  wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_mysql.hh
+elif [ $DB_FLAG = "TFB_PGSQL" ]; then
+  CXX_FLAGS="-I/usr/include/postgresql -I /usr/include/postgresql/12/server -lpthread -lpq"
+  wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_pgsql.hh
+fi
+
+
+wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_http_backend.hh
+
+g++ -flto -DNDEBUG -DN_SQL_CONNECTIONS=$N_SQL_CONNECTIONS -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
+
+/lithium_tbf tfb-database 8080

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-1.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 1

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-10.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 10

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-2.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 2

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-3.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 3

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-4.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 4

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-5.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 5

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-6.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 6

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-7.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 7

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-8.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 8

+ 8 - 0
frameworks/C++/lithium/lithium-mysql-9.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 9

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-1.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 1

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-10.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 10

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-2.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 2

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-3.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 3

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-4.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 4

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-5.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 5

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-6.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 6

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-7.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 7

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-8.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 8

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-9.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_gcc.sh TFB_PGSQL 9

+ 2 - 2
frameworks/C++/lithium/lithium-postgres.dockerfile

@@ -1,8 +1,8 @@
 FROM buildpack-deps:focal
 FROM buildpack-deps:focal
 
 
 RUN apt-get update -yqq
 RUN apt-get update -yqq
-RUN apt-get install -yqq clang libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
 
 
 COPY ./ ./
 COPY ./ ./
 
 
-CMD ./compile_and_start.sh TFB_PGSQL
+CMD ./compile_and_start_gcc.sh TFB_PGSQL NCONN

+ 16 - 11
frameworks/C++/lithium/lithium.cc

@@ -71,17 +71,22 @@ int main(int argc, char* argv[]) {
     s::id(s::auto_increment, s::primary_key) = int(),
     s::id(s::auto_increment, s::primary_key) = int(),
     s::randomNumber = int());
     s::randomNumber = int());
 
 
-#if TFB_MYSQL
-  int db_nconn = 4;
-  int queries_nconn = 2;
-  int fortunes_nconn = 4;
-  int updates_nconn = 1;
-#elif TFB_PGSQL
-  int db_nconn = 7;
-  int queries_nconn = 4;
-  int fortunes_nconn = 7;
-  int updates_nconn = 3;
-#endif
+// #if TFB_MYSQL
+//   int db_nconn = 4;
+//   int queries_nconn = 2;
+//   int fortunes_nconn = 4;
+//   int updates_nconn = 1;
+// #elif TFB_PGSQL
+//   int db_nconn = 7;
+//   int queries_nconn = 4;
+//   int fortunes_nconn = 7;
+//   int updates_nconn = 3;
+// #endif
+
+  int db_nconn = N_SQL_CONNECTIONS;
+  int queries_nconn = N_SQL_CONNECTIONS;
+  int fortunes_nconn = N_SQL_CONNECTIONS;
+  int updates_nconn = N_SQL_CONNECTIONS;
 
 
   http_api my_api;
   http_api my_api;
 
 

+ 2 - 2
frameworks/C++/lithium/lithium.dockerfile

@@ -1,8 +1,8 @@
 FROM buildpack-deps:focal
 FROM buildpack-deps:focal
 
 
 RUN apt-get update -yqq
 RUN apt-get update -yqq
-RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev clang
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev g++-9
 
 
 COPY ./ ./
 COPY ./ ./
 
 
-CMD ./compile_and_start.sh TFB_MYSQL
+CMD ./compile_and_start_gcc.sh TFB_MYSQL 20