Browse Source

Lithium: stop benchmarking sql connections. (#5913)

Matthieu Garrigues 5 years ago
parent
commit
7f70ec9de3
27 changed files with 23 additions and 654 deletions
  1. 2 465
      frameworks/C++/lithium/benchmark_config.json
  2. 2 3
      frameworks/C++/lithium/compile_and_start_clang.sh
  3. 1 2
      frameworks/C++/lithium/compile_and_start_gcc.sh
  4. 0 8
      frameworks/C++/lithium/lithium-mysql-1.dockerfile
  5. 0 8
      frameworks/C++/lithium/lithium-mysql-10.dockerfile
  6. 0 8
      frameworks/C++/lithium/lithium-mysql-2.dockerfile
  7. 0 8
      frameworks/C++/lithium/lithium-mysql-3.dockerfile
  8. 0 8
      frameworks/C++/lithium/lithium-mysql-4.dockerfile
  9. 0 8
      frameworks/C++/lithium/lithium-mysql-5.dockerfile
  10. 0 8
      frameworks/C++/lithium/lithium-mysql-6.dockerfile
  11. 0 8
      frameworks/C++/lithium/lithium-mysql-7.dockerfile
  12. 0 8
      frameworks/C++/lithium/lithium-mysql-8.dockerfile
  13. 0 8
      frameworks/C++/lithium/lithium-mysql-9.dockerfile
  14. 0 8
      frameworks/C++/lithium/lithium-postgres-1.dockerfile
  15. 0 8
      frameworks/C++/lithium/lithium-postgres-10.dockerfile
  16. 0 8
      frameworks/C++/lithium/lithium-postgres-2.dockerfile
  17. 0 8
      frameworks/C++/lithium/lithium-postgres-3.dockerfile
  18. 0 8
      frameworks/C++/lithium/lithium-postgres-4.dockerfile
  19. 0 8
      frameworks/C++/lithium/lithium-postgres-5-clang.dockerfile
  20. 0 8
      frameworks/C++/lithium/lithium-postgres-5.dockerfile
  21. 0 8
      frameworks/C++/lithium/lithium-postgres-6.dockerfile
  22. 0 8
      frameworks/C++/lithium/lithium-postgres-7.dockerfile
  23. 0 8
      frameworks/C++/lithium/lithium-postgres-8.dockerfile
  24. 0 8
      frameworks/C++/lithium/lithium-postgres-9.dockerfile
  25. 2 2
      frameworks/C++/lithium/lithium-postgres.dockerfile
  26. 14 12
      frameworks/C++/lithium/lithium.cc
  27. 2 2
      frameworks/C++/lithium/lithium.dockerfile

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

@@ -25,470 +25,7 @@
         "notes": "",
         "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-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-5-clang": {
-        "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-clang",
-        "notes": "clang with pgo",
-        "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": {
+      "postgres": {
         "json_url"       : "/json",
         "db_url"         : "/db",
         "query_url"      : "/queries?N=",
@@ -507,7 +44,7 @@
         "webserver": "None",
         "os": "Linux",
         "database_os": "Linux",
-        "display_name": "Lithium-postgres-10",
+        "display_name": "Lithium-postgres",
         "notes": "",
         "versus": "None"
       }

+ 2 - 3
frameworks/C++/lithium/compile_and_start_clang.sh

@@ -1,7 +1,6 @@
 #! /bin/sh
 
 DB_FLAG=$1
-N_SQL_CONNECTIONS=$2
 COMMIT=2ea53ab949627baeaaad77e7662da74f9a9d0a31
 
 if [ $DB_FLAG = "TFB_MYSQL" ]; then
@@ -15,9 +14,9 @@ fi
 
 wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_http_backend.hh
 
-clang++ -fprofile-instr-generate=./profile.prof -flto -DN_SQL_CONNECTIONS=$N_SQL_CONNECTIONS -DPROFILE_MODE -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
+clang++ -fprofile-instr-generate=./profile.prof -flto -DPROFILE_MODE -DNDEBUG -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 8081
 llvm-profdata-10 merge -output=./profile.pgo  ./profile.prof
-clang++ -fprofile-instr-use=./profile.pgo -flto -DN_SQL_CONNECTIONS=$N_SQL_CONNECTIONS -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
+clang++ -fprofile-instr-use=./profile.pgo -flto -DNDEBUG -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

+ 1 - 2
frameworks/C++/lithium/compile_and_start_gcc.sh

@@ -1,7 +1,6 @@
 #! /bin/sh
 
 DB_FLAG=$1
-N_SQL_CONNECTIONS=$2
 COMMIT=2ea53ab949627baeaaad77e7662da74f9a9d0a31
 
 if [ $DB_FLAG = "TFB_MYSQL" ]; then
@@ -15,6 +14,6 @@ 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
+g++ -flto -DNDEBUG -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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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

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

@@ -1,8 +0,0 @@
-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
 
 RUN apt-get update -yqq
-RUN apt-get install -yqq g++-9 libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+RUN apt-get install -yqq clang libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
 
 COPY ./ ./
 
-CMD ./compile_and_start_gcc.sh TFB_PGSQL NCONN
+CMD ./compile_and_start_clang.sh TFB_PGSQL

+ 14 - 12
frameworks/C++/lithium/lithium.cc

@@ -71,22 +71,24 @@ int main(int argc, char* argv[]) {
     s::id(s::auto_increment, s::primary_key) = 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
-
+#ifndef N_SQL_CONNECTIONS
+  #if TFB_MYSQL
+    int db_nconn = 5;
+    int queries_nconn = 4;
+    int fortunes_nconn = 5;
+    int updates_nconn = 2;
+  #elif TFB_PGSQL
+    int db_nconn = 5;
+    int queries_nconn = 3;
+    int fortunes_nconn = 7;
+    int updates_nconn = 3;
+  #endif
+#else
   int db_nconn = N_SQL_CONNECTIONS;
   int queries_nconn = N_SQL_CONNECTIONS;
   int fortunes_nconn = N_SQL_CONNECTIONS;
   int updates_nconn = N_SQL_CONNECTIONS;
+#endif
 
   http_api my_api;
 

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

@@ -1,8 +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
+RUN apt-get install -yqq libboost-dev libmariadb-dev wget  libboost-context-dev clang
 
 COPY ./ ./
 
-CMD ./compile_and_start_gcc.sh TFB_MYSQL 20
+CMD ./compile_and_start_clang.sh TFB_MYSQL