Browse Source

Update drogon to the latest version (#4994)

An Tao 6 years ago
parent
commit
36d5df50eb

+ 0 - 21
frameworks/C++/drogon/benchmark_config.json

@@ -25,27 +25,6 @@
         "notes": "",
         "versus": "None"
       },
-      "raw": {
-        "db_url": "/db",
-        "fortune_url": "/fortunes",
-        "query_url": "/queries?queries=",
-        "update_url": "/updates?queries=",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Fullstack",
-        "database": "Postgres",
-        "framework": "drogon",
-        "language": "C++",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "None",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "drogon",
-        "notes": "",
-        "versus": "None"
-      },
       "core": {
         "db_url": "/db",
         "fortune_url": "/fortunes",

+ 1 - 1
frameworks/C++/drogon/drogon-core.dockerfile

@@ -44,7 +44,7 @@ RUN git clone https://github.com/an-tao/drogon
 
 WORKDIR $DROGON_ROOT
 
-RUN git checkout 60ecbb945ece6b7afe289485c098349711810d78
+RUN git checkout 673d74191e30f406cce6dc7450c8d7e08ce30f66
 RUN git submodule update --init
 RUN mkdir build
 

+ 0 - 60
frameworks/C++/drogon/drogon-raw.dockerfile

@@ -1,60 +0,0 @@
-FROM ubuntu:18.04
-
-COPY ./ ./
-
-RUN  apt update -yqq && \
-     apt-get install -yqq software-properties-common && \
-	 apt install -yqq sudo curl wget cmake locales git \
-     openssl libssl-dev \
-     libjsoncpp-dev \
-     uuid-dev libreadline-dev libbison-dev flex \
-     zlib1g-dev && \
-     add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-	 apt update -yqq && \
-	 apt install -yqq gcc-8 g++-8
-
-RUN locale-gen en_US.UTF-8
-
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-
-ENV CC=gcc-8
-ENV CXX=g++-8
-ENV AR=gcc-ar-8
-ENV RANLIB=gcc-ranlib-8
-
-ENV IROOT=/install
-ENV DROGON_ROOT=$IROOT/drogon
-ENV PG_ROOT=$IROOT/postgres-batch_mode_ubuntu
-ENV TEST_PATH=/drogon_benchmark/build
-
-WORKDIR $IROOT
-
-RUN wget https://github.com/an-tao/postgres/archive/batch_mode_ubuntu.tar.gz
-RUN tar -xvzf batch_mode_ubuntu.tar.gz
-WORKDIR $PG_ROOT
-
-RUN ./configure --prefix=/usr CFLAGS='-O2 -pipe'
-RUN make && make install
-
-WORKDIR $IROOT
-
-RUN git clone https://github.com/an-tao/drogon
-
-WORKDIR $DROGON_ROOT
-
-RUN git checkout 60ecbb945ece6b7afe289485c098349711810d78
-RUN git submodule update --init
-RUN mkdir build
-
-WORKDIR $DROGON_ROOT/build
-
-RUN cmake -DCMAKE_BUILD_TYPE=release ..
-RUN make && make install
-
-WORKDIR $TEST_PATH
-
-RUN cmake -DCMAKE_BUILD_TYPE=release ..
-RUN make
-CMD ./drogon_benchmark config-raw.json

+ 1 - 1
frameworks/C++/drogon/drogon.dockerfile

@@ -44,7 +44,7 @@ RUN git clone https://github.com/an-tao/drogon
 
 WORKDIR $DROGON_ROOT
 
-RUN git checkout 60ecbb945ece6b7afe289485c098349711810d78
+RUN git checkout 673d74191e30f406cce6dc7450c8d7e08ce30f66
 RUN git submodule update --init
 RUN mkdir build
 

+ 4 - 81
frameworks/C++/drogon/drogon_benchmark/CMakeLists.txt

@@ -1,94 +1,17 @@
 cmake_minimum_required(VERSION 3.2)
 Project(drogon_benchmark)
 
-link_directories(/usr/local/lib)
-link_libraries(drogon trantor pthread dl)
+set(CMAKE_CXX_STANDARD 17)
 
-IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
-    EXEC_PROGRAM (gcc ARGS "--version | grep '^gcc'|awk '{print $3}' | sed s'/)//g' | sed s'/-.*//g'" OUTPUT_VARIABLE version)
-    MESSAGE(STATUS "This is gcc version:: " ${version})
-    if(version LESS 5.4.0)
-        MESSAGE(STATUS "gcc is too old")
-        stop()
-    elseif(version LESS 7.1.0)
-        set(CMAKE_CXX_STD_FLAGS c++14)
-        MESSAGE(STATUS "c++14")
-    else()
-        set(CMAKE_CXX_STD_FLAGS c++17)
-        set(DR_DEFS "USE_STD_ANY")
-        MESSAGE(STATUS "c++17")
-    endif()
-else()
-    set(CMAKE_CXX_STD_FLAGS c++17)
-endif()
-
-if(CMAKE_BUILD_TYPE STREQUAL "")
-    set(CMAKE_BUILD_TYPE Release)
-endif()
-
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -std=${CMAKE_CXX_STD_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -std=${CMAKE_CXX_STD_FLAGS}")
-
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/)
-
-#jsoncpp
-find_package (Jsoncpp REQUIRED)
-include_directories(${JSONCPP_INCLUDE_DIRS})
-link_libraries(${JSONCPP_LIBRARIES})
-
-#uuid
-find_package (UUID REQUIRED)
-include_directories(${UUID_INCLUDE_DIR})
-link_libraries(${UUID_LIBRARIES})
-
-#OpenSSL
-find_package (OpenSSL)
-if(OpenSSL_FOUND)
-    include_directories(${OPENSSL_INCLUDE_DIR})
-    link_libraries(${OPENSSL_LIBRARIES})
-endif()
-
-#zlib
-find_package(ZLIB REQUIRED)
-include_directories(${ZLIB_INCLUDE_DIR})
-link_libraries(${ZLIB_LIBRARIES})
-
-#find postgres
-find_package(PostgreSQL)
-if(PostgreSQL_FOUND)
-include_directories(${PostgreSQL_INCLUDE_DIR})
-link_libraries(${PostgreSQL_LIBRARIES})
-endif()
-
-#Find mysql, only mariadb client liberary is supported
-find_package(MySQL)
-if(MYSQL_FOUND)
-    message(STATUS "inc:" ${MYSQL_INCLUDE_DIR})
-    message(STATUS "libs:" ${MYSQL_CLIENT_LIBS})
-    message(STATUS "version:" ${MYSQL_VERSION_STRING})
-    if(MYSQL_VERSION_STRING STREQUAL "")
-        message(STATUS "The mysql in your system is not the mariadb, so we can't use it in drogon")
-    else()
-        message(STATUS "Ok! We find the mariadb!")
-        include_directories(${MYSQL_INCLUDE_DIR})
-        link_libraries(${MYSQL_CLIENT_LIBS})
-    endif()
-endif()
-
-#Find sqlite3.
-find_package (SQLite3)
-if (SQLITE3_FOUND)
-  include_directories(${SQLITE3_INCLUDE_DIRS})
-  link_libraries(${SQLITE3_LIBRARIES})
-endif()
+find_package(Drogon REQUIRED)
+link_libraries(${DROGON_LIBRARIES})
+include_directories(${DROGON_INCLUDE_DIRS})
 
 AUX_SOURCE_DIRECTORY(./ SRC_DIR)
 AUX_SOURCE_DIRECTORY(controllers CTL_SRC)
 AUX_SOURCE_DIRECTORY(filters FILTER_SRC)
 AUX_SOURCE_DIRECTORY(models MODEL_SRC)
 
-include_directories(/usr/local/include)
-
 FILE(GLOB SCP_LIST ${CMAKE_CURRENT_SOURCE_DIR}/views/*.csp)
 foreach(cspFile ${SCP_LIST})
     message(STATUS "cspFile:" ${cspFile})

+ 0 - 63
frameworks/C++/drogon/drogon_benchmark/cmake_modules/FindJsoncpp.cmake

@@ -1,63 +0,0 @@
-# Find jsoncpp
-#
-# Find the jsoncpp includes and library
-# 
-# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH 
-# 
-# This module defines
-#  JSONCPP_INCLUDE_DIRS, where to find header, etc.
-#  JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
-#  JSONCPP_FOUND, If false, do not try to use jsoncpp.
-#  JSONCPP_INCLUDE_PREFIX, include prefix for jsoncpp
-
-# only look in default directories
-find_path(
-	JSONCPP_INCLUDE_DIR 
-	NAMES jsoncpp/json/json.h json/json.h
-	DOC "jsoncpp include dir"
-)
-
-find_library(
-	JSONCPP_LIBRARY
-	NAMES jsoncpp
-	DOC "jsoncpp library"
-)
-
-set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
-set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
-
-# debug library on windows
-# same naming convention as in qt (appending debug library with d)
-# boost is using the same "hack" as us with "optimized" and "debug"
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-	find_library(
-		JSONCPP_LIBRARY_DEBUG
-		NAMES jsoncppd
-		DOC "jsoncpp debug library"
-	)
-	
-	set(JSONCPP_LIBRARIES optimized ${JSONCPP_LIBRARIES} debug ${JSONCPP_LIBRARY_DEBUG})
-
-endif()
-
-# find JSONCPP_INCLUDE_PREFIX
-find_path(
-	JSONCPP_INCLUDE_PREFIX
-	NAMES json.h
-	PATH_SUFFIXES jsoncpp/json json
-)
-
-if (${JSONCPP_INCLUDE_PREFIX} MATCHES "jsoncpp")
-	set(JSONCPP_INCLUDE_PREFIX "jsoncpp")
-	set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIRS}/jsoncpp")
-else()
-	set(JSONCPP_INCLUDE_PREFIX "")
-endif()
-
-
-# handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE
-# if all listed variables are TRUE, hide their existence from configuration view
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(jsoncpp DEFAULT_MSG
-	JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
-mark_as_advanced (JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)

+ 0 - 114
frameworks/C++/drogon/drogon_benchmark/cmake_modules/FindMySQL.cmake

@@ -1,114 +0,0 @@
-#--------------------------------------------------------
-# Copyright (C) 1995-2007 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# There are special exceptions to the terms and conditions of the GPL
-# as it is applied to this software. View the full text of the exception
-# in file LICENSE.exceptions in the top-level directory of this software
-# distribution.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-#
-# The MySQL Connector/ODBC is licensed under the terms of the
-# GPL, like most MySQL Connectors. There are special exceptions
-# to the terms and conditions of the GPL as it is applied to
-# this software, see the FLOSS License Exception available on
-# mysql.com.
-
-##########################################################################
-
-
-#-------------- FIND MYSQL_INCLUDE_DIR ------------------
-FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
-  /usr/include/mysql
-  /usr/local/include/mysql
-  /opt/mysql/mysql/include
-  /opt/mysql/mysql/include/mysql
-  /opt/mysql/include
-  /opt/local/include/mysql5
-  /usr/local/mysql/include
-  /usr/local/mysql/include/mysql
-  $ENV{ProgramFiles}/MySQL/*/include
-  $ENV{SystemDrive}/MySQL/*/include)
-
-#----------------- FIND MYSQL_LIB_DIR -------------------
-IF (WIN32)
-  # Set lib path suffixes
-  # dist = for mysql binary distributions
-  # build = for custom built tree
-  IF (CMAKE_BUILD_TYPE STREQUAL Debug)
-    SET(libsuffixDist debug)
-    SET(libsuffixBuild Debug)
-  ELSE (CMAKE_BUILD_TYPE STREQUAL Debug)
-    SET(libsuffixDist opt)
-    SET(libsuffixBuild Release)
-    ADD_DEFINITIONS(-DDBUG_OFF)
-  ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
-
-  FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient
-    PATHS
-    $ENV{MYSQL_DIR}/lib/${libsuffixDist}
-    $ENV{MYSQL_DIR}/libmysql
-    $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
-    $ENV{MYSQL_DIR}/client/${libsuffixBuild}
-    $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
-    $ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist}
-    $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist})
-ELSE (WIN32)
-  FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r mariadbclient
-    PATHS
-    /usr/lib/mysql
-    /usr/local/lib/mysql
-    /usr/local/mysql/lib
-    /usr/local/mysql/lib/mysql
-    /opt/local/mysql5/lib
-    /opt/local/lib/mysql5/mysql
-    /opt/mysql/mysql/lib/mysql
-    /opt/mysql/lib/mysql)
-ENDIF (WIN32)
-
-IF(MYSQL_LIB)
-  GET_FILENAME_COMPONENT(MYSQL_LIB_DIR ${MYSQL_LIB} PATH)
-ENDIF(MYSQL_LIB)
-
-set(MYSQL_VERSION_STRING "")
-
-EXEC_PROGRAM (grep ARGS "MARIADB_BASE_VERSION ${MYSQL_INCLUDE_DIR}/*.h|awk '{print $3}'" OUTPUT_VARIABLE MYSQL_VERSION_STRING)
-
-IF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
-  SET(MYSQL_FOUND TRUE)
-
-  FIND_LIBRARY(MYSQL_ZLIB zlib PATHS ${MYSQL_LIB_DIR})
-  FIND_LIBRARY(MYSQL_TAOCRYPT taocrypt PATHS ${MYSQL_LIB_DIR})
-  IF (MYSQL_LIB)
-    SET(MYSQL_CLIENT_LIBS ${MYSQL_LIB})
-  ELSE()
-    SET(MYSQL_CLIENT_LIBS mysqlclient_r)
-  ENDIF()
-  IF (MYSQL_ZLIB)
-    SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib)
-  ENDIF (MYSQL_ZLIB)
-  IF (MYSQL_TAOCRYPT)
-    SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} taocrypt)
-  ENDIF (MYSQL_TAOCRYPT)
-  # Added needed mysqlclient dependencies on Windows
-  IF (WIN32)
-    SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} ws2_32)
-  ENDIF (WIN32)
-
-  MESSAGE(STATUS "MySQL Include dir: ${MYSQL_INCLUDE_DIR}  library dir: ${MYSQL_LIB_DIR}")
-  MESSAGE(STATUS "MySQL client libraries: ${MYSQL_CLIENT_LIBS}")
-ELSEIF (MySQL_FIND_REQUIRED)
-  MESSAGE(FATAL_ERROR "Cannot find MySQL. Include dir: ${MYSQL_INCLUDE_DIR}  library dir: ${MYSQL_LIB_DIR}")
-ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)

+ 0 - 37
frameworks/C++/drogon/drogon_benchmark/cmake_modules/FindSQLite3.cmake

@@ -1,37 +0,0 @@
-# Copyright (C) 2007-2009 LuaDist.
-# Created by Peter Kapec <[email protected]>
-# Redistribution and use of this file is allowed according to the terms of the MIT license.
-# For details see the COPYRIGHT file distributed with LuaDist.
-#	Note:
-#		Searching headers and libraries is very simple and is NOT as powerful as scripts
-#		distributed with CMake, because LuaDist defines directories to search for.
-#		Everyone is encouraged to contact the author with improvements. Maybe this file
-#		becomes part of CMake distribution sometimes.
-
-# - Find sqlite3
-# Find the native SQLITE3 headers and libraries.
-#
-# SQLITE3_INCLUDE_DIRS	- where to find sqlite3.h, etc.
-# SQLITE3_LIBRARIES	- List of libraries when using sqlite.
-# SQLITE3_FOUND	- True if sqlite found.
-
-# Look for the header file.
-FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)
-
-# Look for the library.
-FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)
-
-# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if all listed variables are TRUE.
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
-
-# Copy the results to the output variables.
-IF(SQLITE3_FOUND)
-	SET(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
-	SET(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
-ELSE(SQLITE3_FOUND)
-	SET(SQLITE3_LIBRARIES)
-	SET(SQLITE3_INCLUDE_DIRS)
-ENDIF(SQLITE3_FOUND)
-
-MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)

+ 0 - 119
frameworks/C++/drogon/drogon_benchmark/cmake_modules/FindUUID.cmake

@@ -1,119 +0,0 @@
-# - Try to find UUID
-# Once done this will define
-#
-# UUID_FOUND - system has UUID
-# UUID_INCLUDE_DIRS - the UUID include directory
-# UUID_LIBRARIES - Link these to use UUID
-# UUID_DEFINITIONS - Compiler switches required for using UUID
-#
-# Copyright (c) 2006 Andreas Schneider <[email protected]>
-#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)
-	# in cache already
-	set(UUID_FOUND TRUE)
-else (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)
-	find_path(UUID_INCLUDE_DIR
-		NAMES
-			uuid.h
-		PATH_SUFFIXES
-			uuid
-		HINTS
-			${UUID_DIR}/include
-			$ENV{UUID_DIR}/include
-			$ENV{UUID_DIR}
-			${DELTA3D_EXT_DIR}/inc
-			$ENV{DELTA_ROOT}/ext/inc
-			$ENV{DELTA_ROOT}
-		PATHS
-			~/Library/Frameworks
-			/Library/Frameworks
-			/usr/local/include
-			/usr/include
-			/usr/include/gdal
-			/sw/include # Fink
-			/opt/local/include # DarwinPorts
-			/opt/csw/include # Blastwave
-			/opt/include
-			[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
-			/usr/freeware/include
-	)
-
-	find_library(UUID_LIBRARY
-		NAMES
-			uuid ossp-uuid
-		HINTS
-			${UUID_DIR}/lib
-			$ENV{UUID_DIR}/lib
-			$ENV{UUID_DIR}
-			${DELTA3D_EXT_DIR}/lib
-			$ENV{DELTA_ROOT}/ext/lib
-			$ENV{DELTA_ROOT}
-			$ENV{OSG_ROOT}/lib
-		PATHS
-			~/Library/Frameworks
-			/Library/Frameworks
-			/usr/local/lib
-			/usr/lib
-			/sw/lib
-			/opt/local/lib
-			/opt/csw/lib
-			/opt/lib
-			/usr/freeware/lib64
-	)
-
-	find_library(UUID_LIBRARY_DEBUG
-		NAMES
-			uuidd 
-		HINTS
-			${UUID_DIR}/lib
-			$ENV{UUID_DIR}/lib
-			$ENV{UUID_DIR}
-			${DELTA3D_EXT_DIR}/lib
-			$ENV{DELTA_ROOT}/ext/lib
-			$ENV{DELTA_ROOT}
-			$ENV{OSG_ROOT}/lib
-		PATHS
-			~/Library/Frameworks
-			/Library/Frameworks
-			/usr/local/lib
-			/usr/lib
-			/sw/lib
-			/opt/local/lib
-			/opt/csw/lib
-			/opt/lib
-			/usr/freeware/lib64
-	)
-	
-	if (NOT UUID_LIBRARY AND BSD)
-		set(UUID_LIBRARY "")
-	endif(NOT UUID_LIBRARY AND BSD)
-
-	set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
-	set(UUID_LIBRARIES ${UUID_LIBRARY})
-
-	if (UUID_INCLUDE_DIRS)
-		if (BSD OR UUID_LIBRARIES)
-			set(UUID_FOUND TRUE)
-		endif (BSD OR UUID_LIBRARIES)
-	endif (UUID_INCLUDE_DIRS)
-
-	if (UUID_FOUND)
-		if (NOT UUID_FIND_QUIETLY)
-			message(STATUS "Found UUID: ${UUID_LIBRARIES}")
-		endif (NOT UUID_FIND_QUIETLY)
-	else (UUID_FOUND)
-		if (UUID_FIND_REQUIRED)
-			message(FATAL_ERROR "Could not find UUID")
-		endif (UUID_FIND_REQUIRED)
-	endif (UUID_FOUND)
-
-	# show the UUID_INCLUDE_DIRS and UUID_LIBRARIES variables only in the advanced view
-	mark_as_advanced(UUID_INCLUDE_DIRS UUID_LIBRARIES)
-
-endif (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)

+ 0 - 174
frameworks/C++/drogon/drogon_benchmark/config-raw.json

@@ -1,174 +0,0 @@
-/* This is a JSON format configuration file
- */
-{
-    //ssl:the global ssl files setting
-    /*
-    "ssl": {
-      "cert": "../../trantor/trantor/tests/server.pem",
-      "key": "../../trantor/trantor/tests/server.pem"
-    },*/
-    "listeners": [{
-        //address:ip address,0.0.0.0 by default
-        "address": "0.0.0.0",
-        //port:port number
-        "port": 8080,
-        //https:if use https for security,false by default
-        "https": false
-    }],
-    "db_clients": [{
-        //name:Name of the client,'default' by default
-        //"name":"",
-        //rdbms:server type, "postgreSQL" by default
-        "rdbms": "postgreSQL",
-        //host:server address,localhost by default
-        "host": "tfb-database",
-        //port:server port, 5432 by default
-        "port": 5432,
-        //dbname:Database name
-        "dbname": "hello_world",
-        //user:'postgres' by default
-        "user": "benchmarkdbuser",
-        //passwd:'' by default
-        "passwd": "benchmarkdbpass",
-        //is_fast: false by default, if it is true, the client is faster but user can't call
-        //any synchronous interface of it.
-        "is_fast": true,
-        //connection_number:1 by default
-        "connection_number": 2
-    }],
-    "app": {
-        //threads_num:the number of IO threads,1 by default, if the value is set to 0, the number of threads
-        //will be the number of processors.
-        "threads_num": 0,
-        //enable_session:false by default
-        "enable_session": false,
-        "session_timeout": 0,
-        //document_root:Root path of HTTP document,defaut path is ./
-        "document_root": "./",
-        /* file_types:
-         * HTTP download file types,The file types supported by drogon
-         * by default are "html", "js", "css", "xml", "xsl", "txt", "svg",
-         * "ttf", "otf", "woff2", "woff" , "eot", "png", "jpg", "jpeg",
-         * "gif", "bmp", "ico", "icns", etc. */
-        "file_types": [
-            "gif",
-            "png",
-            "jpg",
-            "js",
-            "css",
-            "html",
-            "ico",
-            "swf",
-            "xap",
-            "apk",
-            "cur",
-            "xml"
-        ],
-        //max_connections:max connections number,100000 by default
-        "max_connections": 100000,
-        //max_connections_per_ip:max connections number per clinet,0 by default which means no limit
-        "max_connections_per_ip": 0,
-        //Load_dynamic_views: false by default, when set to true, drogon will
-        //compile and load dynamically "CSP View Files" in directories defined
-        //by "dynamic_views_path"
-        //"load_dynamic_views":true,
-        //dynamic_views_path: if the path isn't prefixed with / or ./,
-        //it will be relative path of document_root path
-        //"dynamic_views_path":["./views"],
-        //log:set log output,drogon output logs to stdout by default
-        "log": {
-            //log_path:log file path,empty by default,in which case,log will output to the stdout
-            //"log_path": "./",
-            //logfile_base_name:log file base name,empty by default which means drogon will name logfile as
-            //drogon.log ...
-            "logfile_base_name": "",
-            //log_size_limit:100000000 bytes by default,
-            //When the log file size reaches "log_size_limit", the log file will be switched.
-            "log_size_limit": 100000000,
-            //log_level:"DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
-            //The TRACE level is only valid when built in DEBUG mode.
-            "log_level": "WARN"
-        },
-        //run_as_daemon:false by default
-        "run_as_daemon": false,
-        //relaunch_on_error:false by default,if true,the program will be restart by parent after exit;
-        "relaunch_on_error": false,
-        //use_sendfile:true by default,if ture,the program will
-        //use sendfile() system-call to send static file to client;
-        "use_sendfile": true,
-        //use_gzip:true by default,use gzip to compress the response body's content;
-        "use_gzip": false,
-        //static_files_cache_time:5 (seconds) by default,the time in which static file response is cached,
-        //0 means cache forever,the negative value means no cache
-        "static_files_cache_time": 5,
-        //simple_controllers_map:Configuring mapping from path to simple controller
-        "simple_controllers_map": [
-            {
-                "path": "/db",
-                "controller": "DbCtrlRaw",
-                "http_methods": [
-                    "get"
-                ]
-            },
-            {
-                "path": "/fortunes",
-                "controller": "FortuneCtrlRaw",
-                "http_methods": [
-                    "get"
-                ]
-            },
-            {
-                "path": "/queries",
-                "controller": "QueriesCtrlRaw",
-                "http_methods": [
-                    "get"
-                ]
-            },
-            {
-                "path": "/updates",
-                "controller": "UpdatesCtrlRaw",
-                "http_methods": [
-                    "get"
-                ]
-            }
-        ],
-        //idle_connection_timeout: defaults to 60 seconds, the lifetime 
-        //of the connection without read or write
-        "idle_connection_timeout": 0,
-        //server_header_field: Set the 'server' header field in each response sent by drogon,
-        //empty string by default with which the 'server' header field is set to "Server: drogon/version string\r\n"
-        "server_header_field": "drogon",
-        //keepalive_requests: Set the maximum number of requests that can be served through one keep-alive connection. 
-        //After the maximum number of requests are made, the connection is closed.
-        //The default value of 0 means no limit.
-        "keepalive_requests": 0,
-        //pipelining_requests: Set the maximum number of unhandled requests that can be cached in pipelining buffer. 
-        //After the maximum number of requests are made, the connection is closed.
-        //The default value of 0 means no limit.
-        "pipelining_requests": 0,
-        //gzip_static: If it is set to true, when the client requests a static file, drogon first finds the compressed 
-        //file with the extension ".gz" in the same path and send the compressed file to the client.
-        //The default value of gzip_static is true.
-        "gzip_static": true,
-        //client_max_body_size: Set the max body size of HTTP requests received by drogon. The default value is "1M".
-        //One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
-        "client_max_body_size": "1M",
-        //client_max_websocket_message_size: Set the max size of messages sent by WebSocket client. The default value is "128K".
-        //One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
-        "client_max_websocket_message_size": "128K"
-    },
-    //plugins: Define all plugins running in the application
-    "plugins": [{
-        //name: The class name of the plugin
-        //"name": "TestPlugin",
-        //dependencies: Plugins that the plugin depends on. It can be commented out
-        "dependencies": [],
-        //config: The configuration of the plugin. This json object is the parameter to initialize the plugin.
-        //It can be commented out
-        "config": {
-            "heartbeat_interval": 2
-        }
-    }],
-    //custom_config: custom configuration for users. This object can be get by the app().getCustomConfig() method. 
-    "custom_config": {}
-}

+ 1 - 1
frameworks/C++/drogon/drogon_benchmark/config.json

@@ -34,7 +34,7 @@
         //any synchronous interface of it.
         "is_fast": true,
         //connection_number:1 by default
-        "connection_number": 2
+        "connection_number": 1
     }],
     "app": {
         //threads_num:the number of IO threads,1 by default, if the value is set to 0, the number of threads