Эх сурвалжийг харах

Merge branch 'master' of https://github.com/TechEmpower/FrameworkBenchmarks

jamming 8 жил өмнө
parent
commit
06e8ddc6e9
100 өөрчлөгдсөн 760 нэмэгдсэн , 1211 устгасан
  1. 21 37
      .travis.yml
  2. 0 237
      config/apache2.conf
  3. 0 571
      config/client.c
  4. 0 19
      config/database_sftp_batch
  5. 0 1
      config/erlang.list
  6. 0 93
      config/mongodb.conf
  7. 0 23
      config/ports.conf
  8. 0 4
      config/travis_mysql_setup.sh
  9. 0 133
      config/travis_setup.sh
  10. 0 19
      config/upstart.example/tfb.conf
  11. 6 5
      deployment/vagrant-common/bootstrap.sh
  12. 3 3
      frameworks/C++/cpoll_cppsp/benchmark_config.json
  13. 5 0
      frameworks/C++/cpoll_cppsp/setup_mysql.sh
  14. 5 0
      frameworks/C++/cpoll_cppsp/setup_postgresql.sh
  15. 1 1
      frameworks/C++/cutelyst/setup.sh
  16. 1 1
      frameworks/C++/cutelyst/setup_thread.sh
  17. 1 1
      frameworks/C++/cutelyst/setup_uwsgi_nginx.sh
  18. 1 2
      frameworks/C++/ffead-cpp/setup-apache2-mysql.sh
  19. 1 2
      frameworks/C++/ffead-cpp/setup-apache2-postgresql.sh
  20. 1 2
      frameworks/C++/ffead-cpp/setup-apache2.sh
  21. 1 1
      frameworks/C++/ffead-cpp/setup-mysql.sh
  22. 1 1
      frameworks/C++/ffead-cpp/setup-nginx-mysql.sh
  23. 1 1
      frameworks/C++/ffead-cpp/setup-nginx-postgresql.sh
  24. 1 1
      frameworks/C++/ffead-cpp/setup-postgresql.sh
  25. 1 1
      frameworks/C++/silicon/setup_lwan_mysql.sh
  26. 1 1
      frameworks/C++/silicon/setup_mhd_epoll_mysql.sh
  27. 1 1
      frameworks/C++/silicon/setup_mhd_tpc_mysql.sh
  28. 1 1
      frameworks/C++/treefrog/setup-mongodb.sh
  29. 1 1
      frameworks/C++/treefrog/setup-postgres.sh
  30. 1 1
      frameworks/C++/treefrog/setup-thread.sh
  31. 1 1
      frameworks/C++/treefrog/setup.sh
  32. 1 1
      frameworks/C++/ulib/setup_mongodb.sh
  33. 1 1
      frameworks/C++/ulib/setup_mysql.sh
  34. 1 1
      frameworks/C++/ulib/setup_postgres.sh
  35. 1 1
      frameworks/C++/wt/setup.sh
  36. 1 1
      frameworks/C++/wt/setup_postgres.sh
  37. 1 1
      frameworks/C/h2o/setup.sh
  38. 1 1
      frameworks/C/lwan/setup-mysql.sh
  39. 36 0
      frameworks/C/octane/CMakeLists.txt
  40. 59 0
      frameworks/C/octane/Makefile
  41. 3 0
      frameworks/C/octane/README.md
  42. 23 0
      frameworks/C/octane/benchmark_config.json
  43. 56 0
      frameworks/C/octane/common.cmake
  44. 5 0
      frameworks/C/octane/setup.sh
  45. 5 0
      frameworks/C/octane/src/common.h
  46. 16 0
      frameworks/C/octane/src/connection.c
  47. 25 0
      frameworks/C/octane/src/connection.h
  48. 171 0
      frameworks/C/octane/src/program.c
  49. 54 0
      frameworks/C/octane/src/responders/nobuffer_responder.c
  50. 9 0
      frameworks/C/octane/src/responders/nobuffer_responder.h
  51. 47 0
      frameworks/C/octane/src/responders/sds_responder.c
  52. 9 0
      frameworks/C/octane/src/responders/sds_responder.h
  53. 30 0
      frameworks/C/octane/src/responders/static_responder.c
  54. 18 0
      frameworks/C/octane/src/responders/static_responder.h
  55. 28 0
      frameworks/C/octane/src/write_batch.c
  56. 12 0
      frameworks/C/octane/src/write_batch.h
  57. 1 1
      frameworks/C/onion/setup.sh
  58. 5 5
      frameworks/CSharp/aspnet/benchmark_config.json
  59. 5 0
      frameworks/CSharp/aspnet/setup_mongodb.sh
  60. 5 0
      frameworks/CSharp/aspnet/setup_mysql.sh
  61. 5 0
      frameworks/CSharp/aspnet/setup_postgresql.sh
  62. 2 0
      frameworks/CSharp/aspnetcore/setup-dapper.sh
  63. 2 0
      frameworks/CSharp/aspnetcore/setup-ef.sh
  64. 2 0
      frameworks/CSharp/aspnetcore/setup-raw.sh
  65. 1 1
      frameworks/CSharp/nancy/setup_nginx.sh
  66. 1 1
      frameworks/CSharp/revenj/setup.sh
  67. 1 1
      frameworks/CSharp/servicestack/setup_nginx.sh
  68. 1 1
      frameworks/CSharp/servicestack/setup_xsp.sh
  69. 1 1
      frameworks/Clojure/compojure/setup.sh
  70. 1 1
      frameworks/Clojure/http-kit/setup.sh
  71. 1 1
      frameworks/Clojure/luminus/setup.sh
  72. 1 1
      frameworks/Clojure/pedestal/setup.sh
  73. 1 1
      frameworks/Crystal/kemal/setup-postgres.sh
  74. 1 1
      frameworks/D/vibed/setup.sh
  75. 1 1
      frameworks/D/vibed/setup_ldc.sh
  76. 1 1
      frameworks/Dart/dart-raw/setup.sh
  77. 2 2
      frameworks/Dart/redstone/benchmark_config.json
  78. 5 0
      frameworks/Dart/redstone/setup_mongodb.sh
  79. 5 0
      frameworks/Dart/redstone/setup_postgresql.sh
  80. 2 2
      frameworks/Dart/start/benchmark_config.json
  81. 5 0
      frameworks/Dart/start/setup_mongodb.sh
  82. 5 0
      frameworks/Dart/start/setup_postgresql.sh
  83. 2 2
      frameworks/Dart/stream/benchmark_config.json
  84. 5 0
      frameworks/Dart/stream/setup_mongodb.sh
  85. 5 0
      frameworks/Dart/stream/setup_postgresql.sh
  86. 1 1
      frameworks/Elixir/phoenix/setup.sh
  87. 1 1
      frameworks/Erlang/cowboy/setup.sh
  88. 1 1
      frameworks/Go/beego/setup.sh
  89. 1 1
      frameworks/Go/echo/setup.sh
  90. 1 1
      frameworks/Go/echo/setup_prefork.sh
  91. 1 1
      frameworks/Go/echo/setup_std.sh
  92. 1 1
      frameworks/Go/falcore/setup.sh
  93. 1 1
      frameworks/Go/fasthttp/setup-mysql.sh
  94. 1 1
      frameworks/Go/fasthttp/setup-postgresql.sh
  95. 1 1
      frameworks/Go/gin/setup.sh
  96. 1 1
      frameworks/Go/go-std/setup.sh
  97. 1 1
      frameworks/Go/go-std/setup_mongo.sh
  98. 1 1
      frameworks/Go/go-std/setup_postgres.sh
  99. 1 1
      frameworks/Go/go-std/setup_prefork.sh
  100. 1 1
      frameworks/Go/goji/setup.sh

+ 21 - 37
.travis.yml

@@ -1,26 +1,22 @@
+# Travis CI
+#
+#
+
 sudo: required
 dist: trusty
-language: python
+language: generic
 python:
   - "2.7"
 
 env:
   matrix:
-    #Group tests by directory to logically break up travis-CI build. Otherwise
-    #we end up starting ~200+ different workers. Seems that ~100 is the limit
-    #before their website starts to lag heavily
-    #Here's the bash if you need to update this. Be sure to maintain the
-    #lines that are currently commented out (these cannot run in Travis)
-    #  cd frameworks
-    #  find . -type d -depth 2 | sed 's|./|    - "TESTDIR=|' | sed 's/$/"/g'
-    #
-    #
     - "TESTDIR=C/libreactor"
     - "TESTDIR=C/lwan"
     - "TESTDIR=C/duda"
     - "TESTDIR=C/haywire"
     - "TESTDIR=C/onion"
     - "TESTDIR=C/h2o"
+    - "TESTDIR=C/octane"
     - "TESTDIR=CSharp/aspnet"
     - "TESTDIR=CSharp/aspnetcore"
     ## - "TESTDIR=CSharp/aspnet-stripped"
@@ -197,36 +193,24 @@ env:
     - "TESTDIR=Scala/finch"
     - "TESTDIR=Ur/urweb"
 
-before_install:
-  - pip install colorama==0.3.1
-  # Version 2.3 has a nice Counter() and other features
-  # but it requires —-allow-external and -—allow-unverified
-  - pip install progressbar==2.2
-  - pip install requests
-  - echo "127.0.0.1 " `hostname` | sudo tee /etc/hosts
-  - echo "127.0.0.1 localhost" | sudo tee /etc/hosts
-
-services:
-  - postgresql
-  - redis-server
-  - mongodb
-  - mysql
-
-addons:
-  postgresql: "9.3"
-  apt:
-    packages:
-      - redis-server
-
 before_script:
-  - sudo sysctl -w net.core.somaxconn=65535
-  - sudo ./config/travis_mysql_setup.sh
-  - mysql -uroot < config/create.sql
-  - sudo ./config/create-redis.sh
+  # travis_clean.sh takes care of some services that are baked into the travis
+  # build. Using language: generic gets us an ubuntu build with fewer services,
+  # but includes database installs, ruby and rvm installs, and others that interfere
+  # with running the suite in a clean ubuntu install.
+  - source ./toolset/travis/travis_clean.sh
+
+  # travis_setup.sh runs all the same commands you would run if you were setting up
+  # a development environment via:
+  # http://frameworkbenchmarks.readthedocs.io/en/latest/Development/Installation-Guide/
+  - source ./toolset/travis/travis_setup.sh
 
 script:
-  # Pick one test in this directory and verify
-  - time ./toolset/run-ci.py verify "$TESTDIR"
+  # run-ci.py runs the diffing to see if travis needs to test this framework. Ideally/eventually,
+  # we'd like to try and do the diffing before travis_clean & setup.
+  # This will run the tests exactly as you would in your own vm:
+  # ./toolset/run-tests.py --mode verify --test (all the valid tests for this framework)
+  - ./toolset/run-ci.py verify "$TESTDIR"
 
 cache:
   directories:

+ 0 - 237
config/apache2.conf

@@ -1,237 +0,0 @@
-#
-# Based upon the NCSA server configuration files originally by Rob McCool.
-#
-# This is the main Apache server configuration file.  It contains the
-# configuration directives that give the server its instructions.
-# See http://httpd.apache.org/docs/2.2/ for detailed information about
-# the directives.
-#
-# Do NOT simply read the instructions in here without understanding
-# what they do.  They're here only as hints or reminders.  If you are unsure
-# consult the online docs. You have been warned.  
-#
-# The configuration directives are grouped into three basic sections:
-#  1. Directives that control the operation of the Apache server process as a
-#     whole (the 'global environment').
-#  2. Directives that define the parameters of the 'main' or 'default' server,
-#     which responds to requests that aren't handled by a virtual host.
-#     These directives also provide default values for the settings
-#     of all virtual hosts.
-#  3. Settings for virtual hosts, which allow Web requests to be sent to
-#     different IP addresses or hostnames and have them handled by the
-#     same Apache server process.
-#
-# Configuration and logfile names: If the filenames you specify for many
-# of the server's control files begin with "/" (or "drive:/" for Win32), the
-# server will use that explicit path.  If the filenames do *not* begin
-# with "/", the value of ServerRoot is prepended -- so "foo.log"
-# with ServerRoot set to "/etc/apache2" will be interpreted by the
-# server as "/etc/apache2/foo.log".
-#
-
-### Section 1: Global Environment
-#
-# The directives in this section affect the overall operation of Apache,
-# such as the number of concurrent requests it can handle or where it
-# can find its configuration files.
-#
-
-#
-# ServerRoot: The top of the directory tree under which the server's
-# configuration, error, and log files are kept.
-#
-# NOTE!  If you intend to place this on an NFS (or otherwise network)
-# mounted filesystem then please read the LockFile documentation (available
-# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
-# you will save yourself a lot of trouble.
-#
-# Do NOT add a slash at the end of the directory path.
-#
-#ServerRoot "/etc/apache2"
-
-#
-# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
-#
-LockFile ${APACHE_LOCK_DIR}/accept.lock
-
-#
-# PidFile: The file in which the server should record its process
-# identification number when it starts.
-# This needs to be set in /etc/apache2/envvars
-#
-PidFile ${APACHE_PID_FILE}
-
-#
-# Timeout: The number of seconds before receives and sends time out.
-#
-Timeout 300
-
-#
-# KeepAlive: Whether or not to allow persistent connections (more than
-# one request per connection). Set to "Off" to deactivate.
-#
-KeepAlive On
-
-#
-# MaxKeepAliveRequests: The maximum number of requests to allow
-# during a persistent connection. Set to 0 to allow an unlimited amount.
-# We recommend you leave this number high, for maximum performance.
-#
-MaxKeepAliveRequests 1000
-
-#
-# KeepAliveTimeout: Number of seconds to wait for the next request from the
-# same client on the same connection.
-#
-KeepAliveTimeout 5
-
-##
-## Server-Pool Size Regulation (MPM specific)
-## 
-
-# prefork MPM
-# StartServers: number of server processes to start
-# MinSpareServers: minimum number of server processes which are kept spare
-# MaxSpareServers: maximum number of server processes which are kept spare
-# MaxClients: maximum number of server processes allowed to start
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_prefork_module>
-    StartServers          5
-    MinSpareServers       5
-    MaxSpareServers      10
-    MaxClients          256
-    MaxRequestsPerChild   0
-</IfModule>
-
-# worker MPM
-# StartServers: initial number of server processes to start
-# MinSpareThreads: minimum number of worker threads which are kept spare
-# MaxSpareThreads: maximum number of worker threads which are kept spare
-# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
-#              graceful restart. ThreadLimit can only be changed by stopping
-#              and starting Apache.
-# ThreadsPerChild: constant number of worker threads in each server process
-# MaxClients: maximum number of simultaneous client connections
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_worker_module>
-    StartServers          2
-    MinSpareThreads      25
-    MaxSpareThreads      75 
-    ThreadLimit          64
-    ThreadsPerChild      25
-    MaxClients          256
-    MaxRequestsPerChild   0
-</IfModule>
-
-# event MPM
-# StartServers: initial number of server processes to start
-# MinSpareThreads: minimum number of worker threads which are kept spare
-# MaxSpareThreads: maximum number of worker threads which are kept spare
-# ThreadsPerChild: constant number of worker threads in each server process
-# MaxClients: maximum number of simultaneous client connections
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_event_module>
-    StartServers          2
-    MinSpareThreads      25
-    MaxSpareThreads      75 
-    ThreadLimit          64
-    ThreadsPerChild      25
-    MaxClients          256
-    MaxRequestsPerChild   0
-</IfModule>
-
-# These need to be set in /etc/apache2/envvars
-User ${APACHE_RUN_USER}
-Group ${APACHE_RUN_GROUP}
-
-#
-# AccessFileName: The name of the file to look for in each directory
-# for additional configuration directives.  See also the AllowOverride
-# directive.
-#
-
-AccessFileName .htaccess
-
-#
-# The following lines prevent .htaccess and .htpasswd files from being 
-# viewed by Web clients. 
-#
-<Files ~ "^\.ht">
-    Order allow,deny
-    Deny from all
-    Satisfy all
-</Files>
-
-#
-# DefaultType is the default MIME type the server will use for a document
-# if it cannot otherwise determine one, such as from filename extensions.
-# If your server contains mostly text or HTML documents, "text/plain" is
-# a good value.  If most of your content is binary, such as applications
-# or images, you may want to use "application/octet-stream" instead to
-# keep browsers from trying to display binary files as though they are
-# text.
-#
-# It is also possible to omit any default MIME type and let the
-# client's browser guess an appropriate action instead. Typically the
-# browser will decide based on the file's extension then. In cases
-# where no good assumption can be made, letting the default MIME type
-# unset is suggested  instead of forcing the browser to accept
-# incorrect  metadata.
-#
-DefaultType None
-
-
-#
-# HostnameLookups: Log the names of clients or just their IP addresses
-# e.g., www.apache.org (on) or 204.62.129.132 (off).
-# The default is off because it'd be overall better for the net if people
-# had to knowingly turn this feature on, since enabling it means that
-# each client request will result in AT LEAST one lookup request to the
-# nameserver.
-#
-HostnameLookups Off
-
-# ErrorLog: The location of the error log file.
-# If you do not specify an ErrorLog directive within a <VirtualHost>
-# container, error messages relating to that virtual host will be
-# logged here.  If you *do* define an error logfile for a <VirtualHost>
-# container, that host's errors will be logged there and not here.
-#
-ErrorLog ${APACHE_LOG_DIR}/error.log
-
-#
-# LogLevel: Control the number of messages logged to the error_log.
-# Possible values include: debug, info, notice, warn, error, crit,
-# alert, emerg.
-#
-LogLevel crit
-
-# Include module configuration:
-Include mods-enabled/*.load
-Include mods-enabled/*.conf
-
-# Include all the user configurations:
-Include httpd.conf
-
-# Include ports listing
-Include ports.conf
-
-#
-# The following directives define some format nicknames for use with
-# a CustomLog directive (see below).
-# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
-#
-LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
-LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
-LogFormat "%h %l %u %t \"%r\" %>s %O" common
-LogFormat "%{Referer}i -> %U" referer
-LogFormat "%{User-agent}i" agent
-
-# Include of directories ignores editors' and dpkg's backup files,
-# see README.Debian for details.
-
-# Include generic snippets of statements
-Include conf.d/
-
-# Include the virtual host configurations:
-Include sites-enabled/

+ 0 - 571
config/client.c

@@ -1,571 +0,0 @@
-/*
- * weighttp - a lightweight and simple webserver benchmarking tool
- *
- * Author:
- *     Copyright (c) 2009-2011 Thomas Porzelt
- *
- * License:
- *     MIT, see COPYING file
- */
-
-#include "weighttp.h"
-
-static uint8_t client_parse(Client *client, int size);
-static void client_io_cb(struct ev_loop *loop, ev_io *w, int revents);
-static void client_set_events(Client *client, int events);
-/*
-static void client_add_events(Client *client, int events);
-static void client_rem_events(Client *client, int events);
-static void client_add_events(Client *client, int events) {
-  struct ev_loop *loop = client->worker->loop;
-  ev_io *watcher = &client->sock_watcher;
-
-  if ((watcher->events & events) == events)
-    return;
-
-  ev_io_stop(loop, watcher);
-  ev_io_set(watcher, watcher->fd, watcher->events | events);
-  ev_io_start(loop, watcher);
-}
-
-static void client_rem_events(Client *client, int events) {
-  struct ev_loop *loop = client->worker->loop;
-  ev_io *watcher = &client->sock_watcher;
-
-  if (0 == (watcher->events & events))
-    return;
-
-  ev_io_stop(loop, watcher);
-  ev_io_set(watcher, watcher->fd, watcher->events & ~events);
-  ev_io_start(loop, watcher);
-}
-*/
-
-static void client_set_events(Client *client, int events) {
-  struct ev_loop *loop = client->worker->loop;
-  ev_io *watcher = &client->sock_watcher;
-
-  if (events == (watcher->events & (EV_READ | EV_WRITE)))
-    return;
-
-  ev_io_stop(loop, watcher);
-  ev_io_set(watcher, watcher->fd, (watcher->events & ~(EV_READ | EV_WRITE)) | events);
-  ev_io_start(loop, watcher);
-}
-
-Client *client_new(Worker *worker) {
-  Client *client;
-
-  client = W_MALLOC(Client, 1);
-  client->state = CLIENT_START;
-  client->worker = worker;
-  client->sock_watcher.fd = -1;
-  client->sock_watcher.data = client;
-  client->content_length = -1;
-  client->buffer_offset = 0;
-  client->request_offset = 0;
-  client->keepalive = client->worker->config->keep_alive;
-  client->chunked = 0;
-  client->chunk_size = -1;
-  client->chunk_received = 0;
-
-  return client;
-}
-
-void client_free(Client *client) {
-  if (client->sock_watcher.fd != -1) {
-    ev_io_stop(client->worker->loop, &client->sock_watcher);
-    shutdown(client->sock_watcher.fd, SHUT_WR);
-    close(client->sock_watcher.fd);
-  }
-
-  free(client);
-}
-
-static void client_reset(Client *client) {
-  //printf("keep alive: %d\n", client->keepalive);
-  if (!client->keepalive) {
-    if (client->sock_watcher.fd != -1) {
-      ev_io_stop(client->worker->loop, &client->sock_watcher);
-      shutdown(client->sock_watcher.fd, SHUT_WR);
-      close(client->sock_watcher.fd);
-      client->sock_watcher.fd = -1;
-    }
-
-    client->state = CLIENT_START;
-  } else {
-    client_set_events(client, EV_WRITE);
-    client->state = CLIENT_WRITING;
-    client->worker->stats.req_started++;
-  }
-
-  client->parser_state = PARSER_START;
-  client->buffer_offset = 0;
-  client->parser_offset = 0;
-  client->request_offset = 0;
-  client->ts_start = 0;
-  client->ts_end = 0;
-  client->status_success = 0;
-  client->success = 0;
-  client->content_length = -1;
-  client->bytes_received = 0;
-  client->header_size = 0;
-  client->keepalive = client->worker->config->keep_alive;
-  client->chunked = 0;
-  client->chunk_size = -1;
-  client->chunk_received = 0;
-}
-
-static uint8_t client_connect(Client *client) {
-  //printf("connecting...\n");
-  start:
-
-  if (-1 == connect(client->sock_watcher.fd, client->worker->config->saddr->ai_addr, client->worker->config->saddr->ai_addrlen)) {
-    switch (errno) {
-      case EINPROGRESS:
-      case EALREADY:
-        /* async connect now in progress */
-        client->state = CLIENT_CONNECTING;
-        return 1;
-      case EISCONN:
-        break;
-      case EINTR:
-        goto start;
-      default:
-      {
-        strerror_r(errno, client->buffer, sizeof(client->buffer));
-        W_ERROR("connect() failed: %s (%d)", client->buffer, errno);
-        return 0;
-      }
-    }
-  }
-
-  /* successfully connected */
-  client->state = CLIENT_WRITING;
-  return 1;
-}
-
-static void client_io_cb(struct ev_loop *loop, ev_io *w, int revents) {
-  Client *client = w->data;
-
-  UNUSED(loop);
-  UNUSED(revents);
-
-  client_state_machine(client);
-}
-
-void client_state_machine(Client *client) {
-  int r;
-  Config *config = client->worker->config;
-
-  start:
-  //printf("state: %d\n", client->state);
-  switch (client->state) {
-    case CLIENT_START:
-      client->worker->stats.req_started++;
-
-      do {
-        r = socket(config->saddr->ai_family, config->saddr->ai_socktype, config->saddr->ai_protocol);
-      } while (-1 == r && errno == EINTR);
-
-      if (-1 == r) {
-        client->state = CLIENT_ERROR;
-        strerror_r(errno, client->buffer, sizeof(client->buffer));
-        W_ERROR("socket() failed: %s (%d)", client->buffer, errno);
-        goto start;
-      }
-
-      /* set non-blocking */
-      fcntl(r, F_SETFL, O_NONBLOCK | O_RDWR);
-
-      ev_init(&client->sock_watcher, client_io_cb);
-      ev_io_set(&client->sock_watcher, r, EV_WRITE);
-      ev_io_start(client->worker->loop, &client->sock_watcher);
-
-      if (!client_connect(client)) {
-        client->state = CLIENT_ERROR;
-        goto start;
-      } else {
-        client_set_events(client, EV_WRITE);
-        return;
-      }
-    case CLIENT_CONNECTING:
-      if (!client_connect(client)) {
-        client->state = CLIENT_ERROR;
-        goto start;
-      }
-    case CLIENT_WRITING:
-      while (1) {
-        r = write(client->sock_watcher.fd, &config->request[client->request_offset], config->request_size - client->request_offset);
-        //printf("write(%d - %d = %d): %d\n", config->request_size, client->request_offset, config->request_size - client->request_offset, r);
-        if (r == -1) {
-          /* error */
-          if (errno == EINTR)
-            continue;
-          strerror_r(errno, client->buffer, sizeof(client->buffer));
-          W_ERROR("write() failed: %s (%d)", client->buffer, errno);
-          client->state = CLIENT_ERROR;
-          goto start;
-        } else if (r != 0) {
-          /* success */
-          client->request_offset += r;
-          if (client->request_offset == config->request_size) {
-            /* whole request was sent, start reading */
-            client->state = CLIENT_READING;
-            client_set_events(client, EV_READ);
-          }
-
-          return;
-        } else {
-          /* disconnect */
-          client->state = CLIENT_END;
-          goto start;
-        }
-      }
-    case CLIENT_READING:
-      while (1) {
-        r = read(client->sock_watcher.fd, &client->buffer[client->buffer_offset], sizeof(client->buffer) - client->buffer_offset - 1);
-        
-        //printf("read(): %d, offset was: %d\n", r, client->buffer_offset);
-        if (r == -1) {
-          /* error */
-          if (errno == EINTR)
-            continue;
-          strerror_r(errno, client->buffer, sizeof(client->buffer));
-          W_ERROR("read() failed: %s (%d)", client->buffer, errno);
-          client->state = CLIENT_ERROR;
-        } else if (r != 0) {
-          /* success */
-          client->bytes_received += r;
-          client->buffer_offset += r;
-          client->worker->stats.bytes_total += r;
-
-          if (client->buffer_offset >= sizeof(client->buffer)) {
-            /* too big response header */
-            client->state = CLIENT_ERROR;
-            break;
-          }
-          client->buffer[client->buffer_offset] = '\0';
-          //printf("buffer:\n==========\n%s\n==========\n", client->buffer);
-          if (!client_parse(client, r)) {
-            client->state = CLIENT_ERROR;
-            //printf("parser failed\n");
-            break;
-          } else {
-            if (client->state == CLIENT_END)
-              goto start;
-            else
-              return;
-          }
-        } else {
-          /* disconnect */
-          if (client->parser_state == PARSER_BODY && !client->keepalive && client->status_success
-            && !client->chunked && client->content_length == -1) {
-            client->success = 1;
-            client->state = CLIENT_END;
-          } else {
-            client->state = CLIENT_ERROR;
-          }
-
-          goto start;
-        }
-      }
-
-    case CLIENT_ERROR:
-      //printf("client error\n");
-      client->worker->stats.req_error++;
-      client->keepalive = 0;
-      client->success = 0;
-      client->state = CLIENT_END;
-    case CLIENT_END:
-      /* update worker stats */
-      client->worker->stats.req_done++;
-
-      if (client->success) {
-        client->worker->stats.req_success++;
-        client->worker->stats.bytes_body += client->bytes_received - client->header_size;
-      } else {
-        client->worker->stats.req_failed++;
-      }
-
-      /* print progress every 10% done */
-      if (client->worker->id == 1 && client->worker->stats.req_done % client->worker->progress_interval == 0) {
-        printf("progress: %3d%% done\n",
-          (int) (client->worker->stats.req_done * 100 / client->worker->stats.req_todo)
-        );
-      }
-
-      if (client->worker->stats.req_started == client->worker->stats.req_todo) {
-        /* this worker has started all requests */
-        client->keepalive = 0;
-        client_reset(client);
-
-        if (client->worker->stats.req_done == client->worker->stats.req_todo) {
-          /* this worker has finished all requests */
-          ev_unref(client->worker->loop);
-        }
-      } else {
-        client_reset(client);
-        goto start;
-      }
-  }
-}
-
-
-static uint8_t client_parse(Client *client, int size) {
-  char *end, *str;
-  uint16_t status_code;
-  const int MAX_BUFF = 2048;
-  char* print_buff = malloc(MAX_BUFF);
-  int buff_length = 0;
-
-  switch (client->parser_state) {
-    case PARSER_START:
-      //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "parse (START):\n%s\n", &client->buffer[client->parser_offset]);
-
-      /* look for HTTP/1.1 200 OK */
-      if (client->buffer_offset < sizeof("HTTP/1.1 200\r\n")) {
-        buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 1\n", client->buffer_offset);
-        printf(print_buff);
-        return 1;
-      }
-
-      if (strncmp(client->buffer, "HTTP/1.1 ", sizeof("HTTP/1.1 ")-1) != 0) {
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 1\n");
-        printf(print_buff);
-        return 0;
-      }
-
-      // now the status code
-      status_code = 0;
-      str = client->buffer + sizeof("HTTP/1.1 ")-1;
-      for (end = str + 3; str != end; str++) {
-        if (*str < '0' || *str > '9') {
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 2\n");
-          printf(print_buff);
-          return 0;
-        }
-
-        status_code *= 10;
-        status_code += *str - '0';
-      }
-
-      if (status_code >= 200 && status_code < 300) {
-        client->worker->stats.req_2xx++;
-        client->status_success = 1;
-      } else if (status_code < 400) {
-        client->worker->stats.req_3xx++;
-        client->status_success = 1;
-      } else if (status_code < 500) {
-        client->worker->stats.req_4xx++;
-      } else if (status_code < 600) {
-        client->worker->stats.req_5xx++;
-      } else {
-        // invalid status code
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 3\n");
-        printf(print_buff);
-        return 0;
-      }
-
-      // look for next \r\n
-      end = strchr(end, '\r');
-      if (!end || *(end+1) != '\n') {
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 4\n");
-        printf(print_buff);
-        return 0;
-      }
-
-      client->parser_offset = end + 2 - client->buffer;
-      client->parser_state = PARSER_HEADER;
-    case PARSER_HEADER:
-      //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "parse (HEADER)\n");
-      /* look for Content-Length and Connection header */
-      while (NULL != (end = strchr(&client->buffer[client->parser_offset], '\r'))) {
-        if (*(end+1) != '\n') {
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 5\n");
-          printf(print_buff);
-          return 0;
-        }
-
-        if (end == &client->buffer[client->parser_offset]) {
-          /* body reached */
-          client->parser_state = PARSER_BODY;
-          client->header_size = end + 2 - client->buffer;
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "body reached\n");
-
-          return client_parse(client, size - client->header_size);
-        }
-
-        *end = '\0';
-        str = &client->buffer[client->parser_offset];
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "checking header: '%s'\n", str);
-
-        if (strncasecmp(str, "Content-Length: ", sizeof("Content-Length: ")-1) == 0) {
-          /* content length header */
-          client->content_length = str_to_uint64(str + sizeof("Content-Length: ") - 1);
-        } else if (strncasecmp(str, "Connection: ", sizeof("Connection: ")-1) == 0) {
-          /* connection header */
-          str += sizeof("Connection: ") - 1;
-
-          if (strncasecmp(str, "close", sizeof("close")-1) == 0)
-            client->keepalive = 0;
-          else if (strncasecmp(str, "keep-alive", sizeof("keep-alive")-1) == 0)
-            client->keepalive = client->worker->config->keep_alive;
-          else {
-            //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 6\n");
-            printf(print_buff);
-            return 0;
-          }
-        } else if (strncasecmp(str, "Transfer-Encoding: ", sizeof("Transfer-Encoding: ")-1) == 0) {
-          /* transfer encoding header */
-          str += sizeof("Transfer-Encoding: ") - 1;
-
-          if (strncasecmp(str, "chunked", sizeof("chunked")-1) == 0)
-            client->chunked = 1;
-          else {
-            //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 7\n");
-            printf(print_buff);
-            return 0;
-          }
-        }
-
-
-        if (*(end+2) == '\r' && *(end+3) == '\n') {
-          /* body reached */
-          client->parser_state = PARSER_BODY;
-          client->header_size = end + 4 - client->buffer;
-          client->parser_offset = client->header_size;
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "body reached\n");
-
-          return client_parse(client, size - client->header_size);
-        }
-
-        client->parser_offset = end - client->buffer + 2;
-      }
-      buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 2\n");
-      printf(print_buff);
-      return 1;
-    case PARSER_BODY:
-      //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "parse (BODY)\n");
-      /* do nothing, just consume the data */
-      /*buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "content-l: %"PRIu64", header: %d, recevied: %"PRIu64"\n",
-      client->content_length, client->header_size, client->bytes_received);*/
-
-      if (client->chunked) {
-        int consume_max;
-
-        str = &client->buffer[client->parser_offset];
-        /*buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "parsing chunk: '%s'\n(%"PRIi64" received, %"PRIi64" size, %d parser offset)\n",
-          str, client->chunk_received, client->chunk_size, client->parser_offset
-        );*/
-
-        if (client->chunk_size == -1) {
-          /* read chunk size */
-          client->chunk_size = 0;
-          client->chunk_received = 0;
-          end = str + size;
-
-          for (; str < end; str++) {
-            if (*str == ';' || *str == '\r')
-              break;
-
-            client->chunk_size *= 16;
-            if (*str >= '0' && *str <= '9')
-              client->chunk_size += *str - '0';
-            else if (*str >= 'A' && *str <= 'Z')
-              client->chunk_size += 10 + *str - 'A';
-            else if (*str >= 'a' && *str <= 'z')
-              client->chunk_size += 10 + *str - 'a';
-            else {
-              //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 8\n");
-              printf(print_buff);
-              return 0;
-            }
-          }
-
-          str = strstr(str, "\r\n");
-          if (!str) {
-            //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 9\n");
-            printf(print_buff);
-            return 0;
-          }
-          str += 2;
-
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "---------- chunk size: %"PRIi64", %d read, %d offset, data: '%s'\n", client->chunk_size, size, client->parser_offset, str);
-
-          if (client->chunk_size == 0) {
-            /* chunk of size 0 marks end of content body */
-            client->state = CLIENT_END;
-            client->success = client->status_success ? 1 : 0;
-            if(client->success == 0) {
-              buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 3\n");
-            }
-            printf(print_buff);
-            return 1;
-          }
-
-          size -= str - &client->buffer[client->parser_offset];
-          client->parser_offset = str - client->buffer;
-        }
-
-        /* consume chunk till chunk_size is reached */
-        consume_max = client->chunk_size - client->chunk_received;
-
-        if (size < consume_max)
-          consume_max = size;
-
-        client->chunk_received += consume_max;
-        client->parser_offset += consume_max;
-
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "---------- chunk consuming: %d, received: %"PRIi64" of %"PRIi64", offset: %d\n", consume_max, client->chunk_received, client->chunk_size, client->parser_offset);
-
-        if (client->chunk_received == client->chunk_size) {
-          if (client->buffer[client->parser_offset] != '\r' || client->buffer[client->parser_offset+1] != '\n') {
-            // TE: This was causing problems with resin, which was artificially slowing down the results of some java tests
-            //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 10\n");
-            //printf(print_buff);
-            //return 0;
-          }
-
-          /* got whole chunk, next! */
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "---------- got whole chunk!!\n");
-          client->chunk_size = -1;
-          client->chunk_received = 0;
-          client->parser_offset += 2;
-          consume_max += 2;
-
-          /* there is stuff left to parse */
-          if (size - consume_max > 0)
-            return client_parse(client, size - consume_max);
-        }
-
-        client->parser_offset = 0;
-        client->buffer_offset = 0;
-
-        //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 4\n");
-        printf(print_buff);
-        return 1;
-      } else {
-        /* not chunked, just consume all data till content-length is reached */
-        client->buffer_offset = 0;
-
-        if (client->content_length == -1) {
-          //buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "success 11\n");
-          printf(print_buff);
-          return 0;
-        }
-
-        if (client->bytes_received == (uint64_t) (client->header_size + client->content_length)) {
-          /* full response received */
-          client->state = CLIENT_END;
-          client->success = client->status_success ? 1 : 0;
-        }
-      }
-      buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 5\n");
-      printf(print_buff);
-      return 1;
-  }
-  buff_length += snprintf(print_buff+buff_length, MAX_BUFF-buff_length, "error 6\n");
-  printf(print_buff);
-  return 1;
-}

+ 0 - 19
config/database_sftp_batch

@@ -1,19 +0,0 @@
-lcd ..
-put config/my.cnf
-put config/mongodb.conf
-put config/create.sql
-put config/create.js
-put config/create-postgres-database.sql
-put config/create-postgres.sql
-put config/postgresql.conf
-put config/pg_hba.conf
-put config/usr.sbin.mysqld
-put config/60-postgresql-shm.conf
-put config/mysql
-put config/mysql.conf
--mkdir cassandra
-put -r config/cassandra
--mkdir elasticsearch
-put -r config/elasticsearch
-put config/redis.conf
-put config/create-redis.sh

+ 0 - 1
config/erlang.list

@@ -1 +0,0 @@
-deb http://packages.erlang-solutions.com/debian trusty contrib

+ 0 - 93
config/mongodb.conf

@@ -1,93 +0,0 @@
-# mongodb.conf
-
-# Where to store the data.
-dbpath=/ssd/mongodb
-
-#where to log
-logpath=/ssd/log/mongodb/mongodb.log
-
-logappend=true
-
-bind_ip = 0.0.0.0
-#port = 27017
-
-# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
-journal=true
-
-# Enables periodic logging of CPU utilization and I/O wait
-#cpu = true
-
-# Turn on/off security.  Off is currently the default
-#noauth = true
-#auth = true
-
-# Verbose logging output.
-#verbose = true
-
-# Inspect all client data for validity on receipt (useful for
-# developing drivers)
-#objcheck = true
-
-# Enable db quota management
-#quota = true
-
-# Set oplogging level where n is
-#   0=off (default)
-#   1=W
-#   2=R
-#   3=both
-#   7=W+some reads
-#oplog = 0
-
-# Diagnostic/debugging option
-#nocursors = true
-
-# Ignore query hints
-#nohints = true
-
-# Disable the HTTP interface (Defaults to localhost:27018).
-#nohttpinterface = true
-
-# Turns off server-side scripting.  This will result in greatly limited
-# functionality
-#noscripting = true
-
-# Turns off table scans.  Any query that would do a table scan fails.
-#notablescan = true
-
-# Disable data file preallocation.
-#noprealloc = true
-
-# Specify .ns file size for new databases.
-# nssize = <size>
-
-# Accout token for Mongo monitoring server.
-#mms-token = <token>
-
-# Server name for Mongo monitoring server.
-#mms-name = <server-name>
-
-# Ping interval for Mongo monitoring server.
-#mms-interval = <seconds>
-
-# Replication Options
-
-# in replicated mongo databases, specify here whether this is a slave or master
-#slave = true
-#source = master.example.com
-# Slave only: specify a single database to replicate
-#only = master.example.com
-# or
-#master = true
-#source = slave.example.com
-
-# Address of a server to pair with.
-#pairwith = <server:port>
-# Address of arbiter server.
-#arbiter = <server:port>
-# Automatically resync if slave data is stale
-#autoresync
-# Custom size for replication operation log.
-#oplogSize = <MB>
-# Size limit for in-memory storage of op ids.
-#opIdMem = <bytes>

+ 0 - 23
config/ports.conf

@@ -1,23 +0,0 @@
-# If you just change the port or add more ports here, you will likely also
-# have to change the VirtualHost statement in
-# /etc/apache2/sites-enabled/000-default
-# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
-# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
-# README.Debian.gz
-
-NameVirtualHost *:80
-Listen 80
-Listen 8080
-
-<IfModule mod_ssl.c>
-    # If you add NameVirtualHost *:443 here, you will also have to change
-    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
-    # to <VirtualHost *:443>
-    # Server Name Indication for SSL named virtual hosts is currently not
-    # supported by MSIE on Windows XP.
-    Listen 443
-</IfModule>
-
-<IfModule mod_gnutls.c>
-    Listen 443
-</IfModule>

+ 0 - 4
config/travis_mysql_setup.sh

@@ -1,4 +0,0 @@
-sed -i 's|\[mysqld\]|\[mysqld\]\
-lower_case_table_names = 1\
-character-set-server=utf8\
-collation-server=utf8_general_ci|g' /etc/mysql/my.cnf

+ 0 - 133
config/travis_setup.sh

@@ -1,133 +0,0 @@
-export DEBIAN_FRONTEND=noninteractive
-
-# Turn on command tracing
-set -x 
-
-# Setup Apt For MongoDB
-#   Due to TechEmpower/FrameworkBenchmarks#989 and travis-ci/travis-ci#2655, 
-#   we put this into a loop
-until timeout 15s sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10; do echo 'Waiting for apt-key' ; done
-echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
-
-# Setup apt for Apache Cassandra
-until timeout 15s sudo apt-key adv --keyserver pgp.mit.edu --recv 4BD736A82B5C1B00; do echo 'Waiting for apt-key' ; done
-sudo apt-add-repository  'deb http://www.apache.org/dist/cassandra/debian 20x main'
-
-# Run installation 
-# DO NOT COPY --force-yes TO ANY NON-TRAVIS-CI SCRIPTS! Seriously, it can cause some 
-# major damage and should only be used inside a VM or Linux Container
-sudo apt-get -q update
-sudo apt-get -q -y --force-yes install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
-  mongodb-org \
-  cassandra \
-  openssh-server \
-  mysql-server
-
-# Run as travis user (who already has passwordless sudo)
-ssh-keygen -f /home/travis/.ssh/id_rsa -N '' -t rsa
-cat /home/travis/.ssh/id_rsa.pub > /home/travis/.ssh/authorized_keys
-chmod 600 /home/travis/.ssh/authorized_keys
-
-# Set up the benchmark.cfg for travis user
-# NOTE: Please don't just copy the example config - it causes unexpected
-#       issues when those example variables change
-echo "[Defaults]"                                       > benchmark.cfg
-echo "client_identity_file=/home/travis/.ssh/id_rsa"   >> benchmark.cfg
-echo "database_identity_file=/home/travis/.ssh/id_rsa" >> benchmark.cfg
-echo "client_host=127.0.0.1"                           >> benchmark.cfg
-echo "database_host=127.0.0.1"                         >> benchmark.cfg
-echo "server_host=127.0.0.1"                           >> benchmark.cfg
-echo "client_user=travis"                              >> benchmark.cfg
-echo "database_user=travis"                            >> benchmark.cfg
-
-mkdir installs
-
-# =============Setup Databases===========================
-# NOTE: Do not run `--install database` in travis-ci! 
-#       It changes DB configuration files and will break everything
-# =======================================================
-
-# Setup MySQL
-echo "Populating MySQL database"
-#sudo mysqladmin -u root password secret
-#sudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.orig
-#sudo mv config/my.cnf /etc/mysql/my.cnf
-sudo sed -i 's|#max_connections        = 100|max_connections        = 500|g' /etc/mysql/my.cnf
-sudo restart mysql
-#mysql -uroot -psecret < config/create.sql
-
-# Setup Postgres
-echo "Removing Postgres 9.1 from Travis-CI"
-sudo apt-get remove -qy postgresql postgresql-9.1 postgresql-client-9.1
-sudo apt-get install -qy postgresql-9.3 postgresql-client-9.3
-
-echo "Populating Postgres database"
-psql --version
-sudo useradd benchmarkdbuser -p benchmarkdbpass
-sudo -u postgres psql template1 < config/create-postgres-database.sql
-sudo -u postgres psql hello_world < config/create-postgres.sql
-sudo sed -i "s|#listen_addresses = 'localhost'|listen_addresses = '*'|g" /etc/postgresql/9.3/main/postgresql.conf
-sudo sed -i 's|max_connections = 255|max_connections = 500|g' /etc/postgresql/9.3/main/postgresql.conf
-sudo service postgresql stop
-sudo service postgresql start 9.3
-
-# Setup Apache Cassandra
-echo "Populating Apache Cassandra database"
-for i in {1..15}; do
-nc -z localhost 9160 && break || sleep 1;
-echo "Waiting for Cassandra ($i/15}"
-done
-nc -z localhost 9160
-if [ $? -eq 0 ]; then
-cat config/cassandra/cleanup-keyspace.cql | sudo cqlsh
-python config/cassandra/db-data-gen.py > config/cassandra/tfb-data.cql
-sudo cqlsh -f config/cassandra/create-keyspace.cql
-sudo cqlsh -f config/cassandra/tfb-data.cql
-else
->&2 echo "Cassandra did not start, skipping"
-fi
-
-# Setup Elasticsearch
-curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.deb
-sudo dpkg -i --force-confnew elasticsearch-1.5.0.deb
-sudo update-rc.d elasticsearch defaults 95 10
-sudo service elasticsearch restart
-
-echo "Populating Elasticsearch database"
-for i in {1..15}; do
-nc -z localhost 9200 && break || sleep 1;
-echo "Waiting for Elasticsearch ($i/15}"
-done
-nc -z localhost 9200
-if [ $? -eq 0 ]; then
-curl localhost:9200
-sh config/elasticsearch/es-create-index.sh
-python config/elasticsearch/es-db-data-gen.py > config/elasticsearch/tfb-data.json
-curl -sS -D - -o /dev/null -XPOST localhost:9200/tfb/world/_bulk --data-binary @config/elasticsearch/tfb-data.json
-echo "Elasticsearch DB populated"
-else
->&2 echo "Elasticsearch did not start, skipping"
-fi
-
-# Setup MongoDB
-echo "Populating MongoDB database"
-for i in {1..15}; do
-nc -z localhost 27017 && break || sleep 1;
-echo "Waiting for MongoDB ($i/15}"
-done
-nc -z localhost 27017
-if [ $? -eq 0 ]; then
-mongo < config/create.js
-mongod --version
-else
->&2 echo "MongoDB did not start, skipping"
-fi
-
-# =============Modify Configurations===========================
-# It can be useful to enable debug features for verification 
-# inside Travis-CI
-# =======================================================
-
-sed -i 's|display_errors\] = off|display_errors\] = on|' config/php-fpm.conf
-
-#exit $?

+ 0 - 19
config/upstart.example/tfb.conf

@@ -1,19 +0,0 @@
-# /etc/init/tfb.conf
-env TFB_REPOPARENT="/private"
-env TFB_REPONAME="FrameworkBenchmarks"
-env TFB_REPOURI="https://github.com/ashawnbandy-te-tfb/FrameworkBenchmarks.git"
-env TFB_MAILINGLIST="[email protected]"
-env TFB_MAILING_FROM="[email protected]"
-env TFB_LOGSFOLDER="/private/logs"
-env TFB_REPOBRANCH="45216-continuousbenchmarking-20160609-asb-2"
-setuid techempower
-setgid techempower
-umask 0002
-respawn
-respawn limit 5 2
-script
-  if [ ! -d "$TFB_REPOPARENT/$TFB_REPONAME" ]; then
-    git clone -b $TFB_REPOBRANCH $TFB_REPOURI $TFB_REPOPARENT/$TFB_REPONAME
-  fi
-  exec /$TFB_REPOPARENT/$TFB_REPONAME/toolset/run-continuously.sh
-end script

+ 6 - 5
deployment/vagrant-common/bootstrap.sh

@@ -117,6 +117,12 @@ if [ ! -e "~/.firstboot" ]; then
     source ~/FrameworkBenchmarks/toolset/setup/linux/prerequisites.sh
   #fi
 
+ # Everyone gets SSH access to localhost
+ echo "Setting up SSH access to localhost"
+ ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+
   # Enable remote SSH access if we are running production environment
   # Note : this is always copied from the local working copy using a
   #        file provisioner. While they exist in the git clone we just 
@@ -138,11 +144,6 @@ if [ ! -e "~/.firstboot" ]; then
     chmod 600 ~/.ssh/client ~/.ssh/database
   fi
 
-  # Setup 
-  echo "Installing $ROLE software"
-  cd $FWROOT
-  toolset/run-tests.py --verbose --install $ROLE --install-only --test ''
-
   # Setup a nice welcome message for our guest
   echo "Setting up welcome message"
   sudo rm -f /etc/update-motd.d/51-cloudguest

+ 3 - 3
frameworks/C++/cpoll_cppsp/benchmark_config.json

@@ -22,7 +22,7 @@
       "versus": "cpoll_cppsp"
     },
     "raw": {
-      "setup_file": "setup",
+      "setup_file": "setup_mysql",
       "db_url": "/db",
       "query_url": "/db?queries=",
       "fortune_url": "/fortune",
@@ -44,7 +44,7 @@
       "versus": "cpoll_cppsp"
     },
     "postgres-raw": {
-      "setup_file": "setup",
+      "setup_file": "setup_postgresql",
       "db_url": "/db_pg_async",
       "query_url": "/db_pg_async?queries=", 
       "port": 16969,
@@ -64,7 +64,7 @@
       "versus": "cpoll_cppsp"
     },
     "postgres-raw-threadpool": {
-      "setup_file": "setup",
+      "setup_file": "setup_postgresql",
       "db_url": "/db_pg_threadpool",
       "query_url": "/db_pg_threadpool?queries=", 
       "port": 16969,

+ 5 - 0
frameworks/C++/cpoll_cppsp/setup_mysql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mysql
+
+source ./setup.sh

+ 5 - 0
frameworks/C++/cpoll_cppsp/setup_postgresql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends postgresql
+
+source ./setup.sh

+ 1 - 1
frameworks/C++/cutelyst/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends cutelyst
+fw_depends mysql postgresql cutelyst
 
 sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config.ini
 sed -i 's|SendDate=.*|SendDate=false|g' config/config.ini

+ 1 - 1
frameworks/C++/cutelyst/setup_thread.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends cutelyst
+fw_depends mysql postgresql cutelyst
 
 sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config.ini
 sed -i 's|SendDate=.*|SendDate=false|g' config/config.ini

+ 1 - 1
frameworks/C++/cutelyst/setup_uwsgi_nginx.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends cutelyst nginx
+fw_depends mysql postgresql cutelyst nginx
 
 sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config_socket.ini
 sed -i 's|SendDate=.*|SendDate=false|g' config/config_socket.ini

+ 1 - 2
frameworks/C++/ffead-cpp/setup-apache2-mysql.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-fw_depends apache
-fw_depends ffead-cpp-apache
+fw_depends mysql apache ffead-cpp-apache
 
 export FFEAD_CPP_PATH=/var/www/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 2
frameworks/C++/ffead-cpp/setup-apache2-postgresql.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-fw_depends apache
-fw_depends ffead-cpp-apache
+fw_depends postgresql apache ffead-cpp-apache
 
 export FFEAD_CPP_PATH=/var/www/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 2
frameworks/C++/ffead-cpp/setup-apache2.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-fw_depends apache
-fw_depends ffead-cpp-apache
+fw_depends apache ffead-cpp-apache
 
 export FFEAD_CPP_PATH=/var/www/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 1
frameworks/C++/ffead-cpp/setup-mysql.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ffead-cpp
+fw_depends mysql ffead-cpp
 
 export FFEAD_CPP_PATH=$TROOT/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 1
frameworks/C++/ffead-cpp/setup-nginx-mysql.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ffead-cpp-nginx
+fw_depends mysql ffead-cpp-nginx
 
 export FFEAD_CPP_PATH=$TROOT/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 1
frameworks/C++/ffead-cpp/setup-nginx-postgresql.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ffead-cpp-nginx
+fw_depends postgresql ffead-cpp-nginx
 
 export FFEAD_CPP_PATH=$TROOT/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 1
frameworks/C++/ffead-cpp/setup-postgresql.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ffead-cpp
+fw_depends postgresql ffead-cpp
 
 export FFEAD_CPP_PATH=$TROOT/ffead-cpp-2.0
 export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH

+ 1 - 1
frameworks/C++/silicon/setup_lwan_mysql.sh

@@ -1,6 +1,6 @@
 #! /bin/bash
  
-fw_depends silicon lwan
+fw_depends mysql silicon lwan
 
 rm -rf build
 mkdir build

+ 1 - 1
frameworks/C++/silicon/setup_mhd_epoll_mysql.sh

@@ -1,6 +1,6 @@
 #! /bin/bash
 
-fw_depends silicon microhttpd
+fw_depends mysql silicon microhttpd
 
 rm -rf build
 mkdir build

+ 1 - 1
frameworks/C++/silicon/setup_mhd_tpc_mysql.sh

@@ -1,6 +1,6 @@
 #! /bin/bash
 
-fw_depends silicon microhttpd
+fw_depends mysql silicon microhttpd
 
 rm -rf build
 mkdir build

+ 1 - 1
frameworks/C++/treefrog/setup-mongodb.sh

@@ -5,7 +5,7 @@ sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/mongodb.ini
 sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
-fw_depends treefrog
+fw_depends mongodb treefrog
 
 # 1. Generate Makefile
 qmake -r CONFIG+=release

+ 1 - 1
frameworks/C++/treefrog/setup-postgres.sh

@@ -5,7 +5,7 @@ sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/mongodb.ini
 sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
 sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
-fw_depends treefrog
+fw_depends postgresql treefrog
 
 # 1. Generate Makefile
 qmake -r CONFIG+=release

+ 1 - 1
frameworks/C++/treefrog/setup-thread.sh

@@ -5,7 +5,7 @@ sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/mongodb.ini
 sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
-fw_depends treefrog
+fw_depends mysql treefrog
 
 # 1. Generate Makefile
 qmake -r CONFIG+=release

+ 1 - 1
frameworks/C++/treefrog/setup.sh

@@ -5,7 +5,7 @@ sed -i 's|HostName=.*|HostName='"$DBHOST"'|g' config/mongodb.ini
 sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=hybrid|g' config/application.ini
 
-fw_depends treefrog
+fw_depends mysql treefrog
 
 # 1. Generate Makefile
 qmake -r CONFIG+=release

+ 1 - 1
frameworks/C++/ulib/setup_mongodb.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ulib
+fw_depends mongodb ulib
 
 # Travis is broken
 if [ "$TRAVIS" != "true" ]; then

+ 1 - 1
frameworks/C++/ulib/setup_mysql.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ulib
+fw_depends mysql ulib
 
 # Travis is broken
 if [ "$TRAVIS" != "true" ]; then

+ 1 - 1
frameworks/C++/ulib/setup_postgres.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends ulib
+fw_depends postgresql ulib
 
 MAX_THREADS=$(( 2 * $MAX_THREADS ))
 

+ 1 - 1
frameworks/C++/wt/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends apache wt
+fw_depends mysql apache wt
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 1 - 1
frameworks/C++/wt/setup_postgres.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends apache wt
+fw_depends postgresql apache wt
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 1 - 1
frameworks/C/h2o/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends h2o mustache-c yajl
+fw_depends postgresql h2o mustache-c yajl
 
 H2O_APP_HOME="${IROOT}/h2o_app"
 BUILD_DIR="${H2O_APP_HOME}_build"

+ 1 - 1
frameworks/C/lwan/setup-mysql.sh

@@ -6,7 +6,7 @@ export MYSQL_PASS=benchmarkdbpass
 export MYSQL_HOST=$DBHOST
 export MYSQL_DB=hello_world
 
-fw_depends lwan
+fw_depends mysql lwan
 
 cd $LWAN_ROOT/techempower
 $LWAN_BUILD/techempower/techempower &

+ 36 - 0
frameworks/C/octane/CMakeLists.txt

@@ -0,0 +1,36 @@
+cmake_minimum_required(VERSION 2.6)
+include(CMakeToolsHelpers OPTIONAL)
+include("common.cmake")
+
+# ----------------------------------------
+# Benchmark service
+# ----------------------------------------
+file(GLOB_RECURSE TECHEMPOWER_BENCHMARKS_SOURCES
+    ${CMAKE_CURRENT_SOURCE_DIR}/lib/octane/lib/sds/*.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/lib/octane/lib/sds/*.c
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
+
+list(SORT TECHEMPOWER_BENCHMARKS_SOURCES)
+create_source_group("Source Files" "${CMAKE_CURRENT_SOURCE_DIR}/src" ${TECHEMPOWER_BENCHMARKS_SOURCES})
+include_directories(${CMAKE_SOURCE_DIR}/lib/octane/lib/libuv/include)
+include_directories(${CMAKE_SOURCE_DIR}/lib/octane/lib/sds)
+include_directories(${CMAKE_SOURCE_DIR}/lib/octane/include)
+include_directories(${CMAKE_SOURCE_DIR}/include)
+
+find_package(Threads REQUIRED)
+
+add_executable (techempower_benchmarks
+    ${TECHEMPOWER_BENCHMARKS_SOURCES})
+
+# Libraries to link in reverse order because that's what ld requires.
+target_link_libraries (techempower_benchmarks
+    ${CMAKE_SOURCE_DIR}/lib/octane/build/liboctane.a
+    ${CMAKE_SOURCE_DIR}/lib/octane/lib/libuv/.libs/libuv.a
+    ${CMAKE_THREAD_LIBS_INIT})
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+    target_link_libraries (hello_world rt)
+endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

+ 59 - 0
frameworks/C/octane/Makefile

@@ -0,0 +1,59 @@
+projectpath = ${CURDIR}
+octane_path = ${projectpath}/lib/octane
+
+ifeq ($(OS),Windows_NT)
+		OPERATING_SYSTEM = WINDOWS
+    CCFLAGS += -D WIN32
+    ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
+        CCFLAGS += -D AMD64
+    else
+        ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
+            CCFLAGS += -D AMD64
+        endif
+        ifeq ($(PROCESSOR_ARCHITECTURE),x86)
+            CCFLAGS += -D IA32
+        endif
+    endif
+else
+    UNAME_S := $(shell uname -s)
+    ifeq ($(UNAME_S),Linux)
+				OPERATING_SYSTEM = LINUX
+				PLATFORM_TARGET = linux
+        CCFLAGS += -D LINUX
+    endif
+    ifeq ($(UNAME_S),Darwin)
+				OPERATING_SYSTEM = OSX
+				PLATFORM_TARGET = osx
+        CCFLAGS += -D OSX
+    endif
+    UNAME_P := $(shell uname -p)
+    ifeq ($(UNAME_P),x86_64)
+        CCFLAGS += -D AMD64
+    endif
+    ifneq ($(filter %86,$(UNAME_P)),)
+        CCFLAGS += -D IA32
+    endif
+    ifneq ($(filter arm%,$(UNAME_P)),)
+        CCFLAGS += -D ARM
+    endif
+endif
+
+all: deps $(PLATFORM_TARGET)
+
+target: all
+
+osx: deps
+	if [ ! -d "build" ]; then mkdir -p build; fi
+	if [ ! -d "build/Makefile" ]; then cd build;cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 ..; fi
+	cmake --build ./build --target all --config Debug -- -j 10
+
+xcode: deps
+	if [ ! -d "build" ]; then mkdir -p build; fi
+	if [ ! -d "build/techempower_benchmarks.xcodeproj" ]; then cd build;cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -G Xcode ..; fi
+	cd build;xcodebuild -project techempower_benchmarks.xcodeproj/
+
+$(octane_path)/build/liboctane.a:
+	if [ ! -d "$(octane_path)" ]; then git clone https://github.com/simongui/octane.git $(octane_path); fi
+	cd $(octane_path);make
+
+deps: $(octane_path)/build/liboctane.a

+ 3 - 0
frameworks/C/octane/README.md

@@ -0,0 +1,3 @@
+# OCTANE
+
+Benchmarks for the [octane](http://github.com/simongui/octane) library.

+ 23 - 0
frameworks/C/octane/benchmark_config.json

@@ -0,0 +1,23 @@
+{
+  "framework": "octane",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "plaintext_url": "/",
+      "port": 8000,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "None",
+      "framework": "None",
+      "language": "C",
+      "flavor": "None",
+      "orm": "Raw",
+      "platform": "None",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "notes": "",
+      "versus": "octane"
+    }
+  }]
+}

+ 56 - 0
frameworks/C/octane/common.cmake

@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 2.6)
+
+# create_source_group(relativeSourcePath sourceGroupName files)
+#
+# Creates a source group with the specified name relative to the relative path
+# specified.
+#
+# Parameters:
+#    - sourceGroupName: Name of the source group to create.
+#    - relativeSourcePath: Relative path to the files.
+#    - sourceFiles: Files to add to the source group.
+#
+# For example if you have the following directory structure:
+#
+#    - ExampleApplication
+#        - include
+#            - Main.h
+#                - Window
+#                    Window.h
+#        - source
+#            - Main.cpp
+#                - Window
+#                    Window.cpp
+#
+# You can get your list of files and call create_source_group the following way
+#
+#    file(GLOB_RECURSE my_source_files ${CMAKE_CURRENT_SOURCE_DIR}/source/*)
+#    create_source_group("Source Files" "${CMAKE_CURRENT_SOURCE_DIR}/source" ${my_source_files})
+#    file(GLOB_RECURSE my_header_files ${CMAKE_CURRENT_SOURCE_DIR}/include/*)
+#    create_source_group("Header Files" "${CMAKE_CURRENT_SOURCE_DIR}/include" ${my_header_files})
+#    add_executable(ExampleApplication ${my_source_files} ${my_header_files})
+#
+# Then the generated solution would look like this
+#
+#    - ExampleApplication (project)
+#        - Header Files
+#            - Main.h
+#                - Window
+#                    Window.h
+#        - Source Files
+#            - Main.cpp
+#                - Window
+#                    Window.cpp
+#
+function(create_source_group sourceGroupName relativeSourcePath)
+    FOREACH(currentSourceFile ${ARGN})
+        FILE(RELATIVE_PATH folder ${relativeSourcePath} ${currentSourceFile})
+        get_filename_component(filename ${folder} NAME)
+        string(REPLACE ${filename} "" folder ${folder})
+        if(NOT folder STREQUAL "")
+            string(REGEX REPLACE "/+$" "" folderlast ${folder})
+            string(REPLACE "/" "\\" folderlast ${folderlast})
+            SOURCE_GROUP("${sourceGroupName}\\${folderlast}" FILES ${currentSourceFile})
+        endif(NOT folder STREQUAL "")
+    ENDFOREACH(currentSourceFile ${ARGN})
+endfunction(create_source_group)

+ 5 - 0
frameworks/C/octane/setup.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends octane
+
+hello_world 8000 40 &

+ 5 - 0
frameworks/C/octane/src/common.h

@@ -0,0 +1,5 @@
+#pragma once
+
+#define memory_error(fmt, ...) do { \
+        fprintf(stderr, "%s: %s (%d): not enough memory: " fmt "\n", __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
+} while (0)

+ 16 - 0
frameworks/C/octane/src/connection.c

@@ -0,0 +1,16 @@
+#include <stdlib.h>
+#include <octane.h>
+#include "connection.h"
+
+connection* create_connection()
+{
+    connection* conn = calloc(1, sizeof(connection));
+    conn->bytes_remaining = 0;
+    conn->request_length = 0;
+    conn->keep_alive = true;
+    return conn;
+}
+
+void free_connection(connection* conn) {
+    free(conn);
+}

+ 25 - 0
frameworks/C/octane/src/connection.h

@@ -0,0 +1,25 @@
+#pragma once
+
+#include <stdbool.h>
+
+typedef struct
+{
+    uv_tcp_t stream;
+    enum {OPEN, CLOSING, CLOSED} state;
+    void* data;
+    bool keep_alive;
+    int bytes_remaining;
+    int request_length;
+} connection;
+
+typedef enum {
+    OK,
+    SIZE_EXCEEDED,
+    BAD_REQUEST,
+    INTERNAL_ERROR
+} request_state;
+
+connection* create_connection();
+void free_connection(connection* conn);
+
+char* current_time;

+ 171 - 0
frameworks/C/octane/src/program.c

@@ -0,0 +1,171 @@
+#include <stdio.h>
+#include <uv.h>
+#include <stdlib.h>
+#include <octane.h>
+#include <time.h>
+#include "common.h"
+#include "connection.h"
+#include "responders/static_responder.h"
+#include "responders/sds_responder.h"
+#include "responders/nobuffer_responder.h"
+
+typedef struct {
+  uv_write_t req;
+  uv_buf_t buf;
+} write_req_t;
+
+void stream_on_connect(uv_stream_t* stream, int status);
+void stream_on_alloc(uv_handle_t* client, size_t suggested_size, uv_buf_t* buf);
+void stream_on_read(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf);
+void timer_callback(uv_timer_t* timer);
+
+void (*stream_on_read_func)(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
+
+uv_timer_t timer;
+
+int main(int args, char **argsv) {
+    //stream_on_read_func = &stream_on_read_static;
+    stream_on_read_func = &stream_on_read_sds;
+    //stream_on_read_func = &stream_on_read_nobuffer;
+
+    uv_async_t* service_handle = 0;
+    uv_loop_t* loop = uv_default_loop();
+
+    uv_timer_init(loop, &timer);
+    uv_timer_start(&timer, timer_callback, 0, 500);
+
+    uv_multi_listen("0.0.0.0", 8000, false, 40, DISPATCH_TYPE_REUSEPORT, loop, 128, stream_on_connect);
+}
+
+void send_error_response(connection* conn, request_state state) {
+
+}
+
+void stream_on_close(uv_handle_t* handle)
+{
+    uv_handle_t* stream = handle;
+    connection* conn = stream->data;
+
+    if (conn->state != CLOSED) {
+        conn->state = CLOSED;
+        connection* conn = (connection*)handle->data;
+        free_connection(conn);
+    }
+}
+
+void stream_close_connection(connection* conn) {
+    if (conn->state == OPEN) {
+        conn->state = CLOSING;
+        uv_close(&conn->stream, stream_on_close);
+    }
+}
+
+void handle_request_error(connection* conn, request_state state)
+{
+    uv_handle_t* stream = &conn->stream;
+
+    if (conn->state == OPEN) {
+        uv_read_stop(stream);
+    }
+
+    conn->keep_alive = false;
+
+    if (conn->state == OPEN) {
+        /* Send the error message back. */
+        send_error_response(conn, state);
+    } else {
+        stream_close_connection(conn);
+    }
+}
+
+void handle_bad_request(connection* conn)
+{
+    handle_request_error(conn, BAD_REQUEST);
+}
+
+void handle_buffer_exceeded_error(connection* conn)
+{
+    handle_request_error(conn, SIZE_EXCEEDED);
+}
+
+void handle_internal_error(connection* conn)
+{
+    handle_request_error(conn, INTERNAL_ERROR);
+}
+
+void stream_on_shutdown(uv_shutdown_t* req, int status)
+{
+    connection* conn = req->data;
+    uv_handle_t* stream = &conn->stream;
+    if (conn->state == OPEN) {
+        stream_close_connection(conn);
+    }
+    free(req);
+}
+
+void stream_on_connect(uv_stream_t* server_stream, int status) {
+    /* TODO: Use the return values from uv_accept() and uv_read_start() */
+    int rc = 0;
+
+    connection* conn = create_connection();
+    rc = uv_tcp_init(server_stream->loop, (uv_stream_t*)&conn->stream);
+    conn->bytes_remaining = 0;
+    conn->request_length = 0;
+    conn->stream.data = conn;
+
+    rc = uv_accept(server_stream, (uv_stream_t*)&conn->stream);
+    uv_read_start((uv_stream_t*)&conn->stream, stream_on_alloc, stream_on_read);
+}
+
+void stream_on_alloc(uv_handle_t* client, size_t suggested_size, uv_buf_t* buf) {
+    char* buffer;
+    if(!(buffer = malloc(suggested_size))){
+        memory_error("Unable to allocate buffer of size %d", suggested_size);
+    }
+    *buf = uv_buf_init(buffer, suggested_size);
+}
+
+void stream_on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
+    connection* conn = stream->data;
+
+    if (nread > 0) {
+        if (conn->request_length == 0) {
+            // We need to seek the first request to find out how many characters each request is.
+            for (int i = 1; i < nread; i++) {
+                if (buf->base[i] == '\r' && buf->base[i - 1] == '\n') {
+                    conn->request_length = i + 2;
+                    break;
+                }
+            }
+        }
+
+        ssize_t requests = (nread + conn->bytes_remaining) / conn->request_length;
+        conn->bytes_remaining = conn->bytes_remaining + (nread % conn->request_length);
+
+        stream_on_read_func(conn, requests, stream, nread, buf);
+    }
+    else if (nread == UV_ENOBUFS) {
+        handle_buffer_exceeded_error(conn);
+    }
+    else if (nread == UV_EOF){
+        uv_shutdown_t* req = malloc(sizeof(uv_shutdown_t));
+        req->data = conn;
+        uv_shutdown(req, &conn->stream, stream_on_shutdown);
+    }
+    else if (nread == UV_ECONNRESET || nread == UV_ECONNABORTED) {
+        /* Let's close the connection as the other peer just disappeared */
+        stream_close_connection(conn);
+    } else {
+        /* We didn't see this coming, but an unexpected UV error code was passed in, so we'll
+         * respond with a blanket 500 error if we can */
+        handle_internal_error(conn);
+    }
+    free(buf->base);
+}
+
+void timer_callback(uv_timer_t* timer) {
+    time_t curtime;
+    time(&curtime);
+    char* time = ctime(&curtime);
+    current_time = time;
+}

+ 54 - 0
frameworks/C/octane/src/responders/nobuffer_responder.c

@@ -0,0 +1,54 @@
+#include <stdlib.h>
+#include <uv.h>
+#include "nobuffer_responder.h"
+#include "../write_batch.h"
+
+void create_response_nobuffer(write_batch* batch) {
+    batch->buffers[batch->number_of_used_buffers].base = "HTTP/1.1 200 OK\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 17;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "Server: octane\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 28;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "Content-Type: text/plain\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 26;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "Content-Length: 15\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 20;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "Date: Mon Dec 12 00:00:00 2016\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 32;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "\r\n";
+    batch->buffers[batch->number_of_used_buffers].len = 2;
+    batch->number_of_used_buffers++;
+
+    batch->buffers[batch->number_of_used_buffers].base = "Hello, World!\n\n";
+    batch->buffers[batch->number_of_used_buffers].len = 15;
+    batch->number_of_used_buffers++;
+}
+
+void stream_on_read_nobuffer(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
+    uv_write_t *write_req = create_write_with_batch(requests * 7);
+    write_batch* batch = write_req->data;
+
+    for (int i=0; i<requests; i++) {
+        create_response_nobuffer(batch);
+    }
+
+    if (uv_is_writable(stream)) {
+        // TODO: Use the return values from uv_write()
+        int rc = uv_write(write_req, stream, batch->buffers, batch->number_of_used_buffers, after_write_nobuffer);
+    } else {
+        // TODO: Handle closing the stream.
+    }
+}
+
+void after_write_nobuffer(uv_write_t* req, int status) {
+    free(req);
+}

+ 9 - 0
frameworks/C/octane/src/responders/nobuffer_responder.h

@@ -0,0 +1,9 @@
+#pragma once
+
+#include <uv.h>
+#include "../connection.h"
+#include "../write_batch.h"
+
+void create_response_nobuffer(write_batch* batch);
+void stream_on_read_nobuffer(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
+void after_write_nobuffer(uv_write_t* req, int status);

+ 47 - 0
frameworks/C/octane/src/responders/sds_responder.c

@@ -0,0 +1,47 @@
+#include <uv.h>
+#include <sds.h>
+#include "sds_responder.h"
+#include "../connection.h"
+#include "../write_batch.h"
+
+void create_response_sds(write_batch* batch) {
+    //sds response_buffer = sdsnew("HTTP/1.1 200 OK\r\nServer: octane/master\r\nContent-Type: text/plain\r\nContent-Length: 15\r\n");
+    //response_buffer = sdscat(response_buffer, "Date: Mon Dec 12 00:00:00 2016\r\n");
+    //response_buffer = sdscat(response_buffer, "\r\nHello, World!\n\n");
+
+    sds response_buffer = sdsnew("HTTP/1.1 200 OK\r\n");
+    response_buffer = sdscat(response_buffer, "Server: octane\r\n");
+    response_buffer = sdscat(response_buffer, "Content-Type: text/plain\r\n");
+    response_buffer = sdscat(response_buffer, "Content-Length: 15\r\n");
+    response_buffer = sdscatprintf(response_buffer, "Date: %s", current_time);
+    response_buffer = sdscat(response_buffer, "\r\nHello, World!\n\n");
+
+    batch->buffers[batch->number_of_used_buffers].base = response_buffer;
+    batch->buffers[batch->number_of_used_buffers].len = sdslen(response_buffer);
+    batch->number_of_used_buffers++;
+}
+
+void stream_on_read_sds(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
+    uv_write_t *write_req = create_write_with_batch(requests);
+    write_batch* batch = write_req->data;
+
+    for (int i=0; i<requests; i++) {
+        create_response_sds(batch);
+    }
+
+    if (uv_is_writable(stream)) {
+        // TODO: Use the return values from uv_write()
+        int rc = uv_write(write_req, stream, batch->buffers, batch->number_of_used_buffers, after_write_sds);
+    } else {
+        // TODO: Handle closing the stream.
+    }
+}
+
+void after_write_sds(uv_write_t* req, int status) {
+    write_batch* batch = get_write_batch(req);
+    for (int i=0; i<batch->number_of_used_buffers; i++) {
+        sds buffer = batch->buffers[i].base;
+        sdsfree(buffer);
+    }
+    free(req);
+}

+ 9 - 0
frameworks/C/octane/src/responders/sds_responder.h

@@ -0,0 +1,9 @@
+#pragma once
+
+#include <uv.h>
+#include "../connection.h"
+#include "../write_batch.h"
+
+void create_response_sds(write_batch* batch);
+void stream_on_read_sds(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
+void after_write_sds(uv_write_t* req, int status);

+ 30 - 0
frameworks/C/octane/src/responders/static_responder.c

@@ -0,0 +1,30 @@
+#include <stdlib.h>
+#include <uv.h>
+#include "static_responder.h"
+
+void create_response_static(write_batch* batch) {
+    batch->buffers[batch->number_of_used_buffers].base = RESPONSE;
+    batch->buffers[batch->number_of_used_buffers].len = sizeof(RESPONSE);
+    batch->number_of_used_buffers++;
+}
+
+void stream_on_read_static(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
+    uv_write_t *write_req = create_write_with_batch(requests);
+    write_batch* batch = write_req->data;
+
+    for (int i=0; i<requests; i++) {
+        create_response_static(batch);
+    }
+
+    if (uv_is_writable(stream)) {
+        // TODO: Use the return values from uv_write()
+        int rc = uv_write(write_req, stream, batch->buffers, batch->number_of_used_buffers, after_write_static);
+    } else {
+        // TODO: Handle closing the stream.
+    }
+}
+
+void after_write_static(uv_write_t* req, int status) {
+    free(req);
+}
+

+ 18 - 0
frameworks/C/octane/src/responders/static_responder.h

@@ -0,0 +1,18 @@
+#pragma once
+
+#include <uv.h>
+#include "../connection.h"
+#include "../write_batch.h"
+
+#define RESPONSE \
+    "HTTP/1.1 200 OK\r\n" \
+    "Server: octane\r\n" \
+    "Date: Mon Dec 12 00:00:00 2016\r\n" \
+    "Content-Type: text/plain\r\n" \
+    "Content-Length: 15\r\n" \
+    "\r\n" \
+    "Hello, World!\n"
+
+void create_response_static(write_batch* batch);
+void stream_on_read_static(connection* conn, size_t requests, uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
+void after_write_static(uv_write_t* req, int status);

+ 28 - 0
frameworks/C/octane/src/write_batch.c

@@ -0,0 +1,28 @@
+#include <stdlib.h>
+#include "write_batch.h"
+#include "common.h"
+
+uv_write_t* create_write_with_batch(size_t number_of_total_buffers) {
+    /*
+     * Allocate the 3 structures and array of buffers in one malloc call
+     * to reduce malloc() contention across CPU cores.
+     */
+    uv_write_t *write_req;
+    size_t bytes = sizeof(*write_req) + sizeof(write_batch) + (sizeof(uv_buf_t) * number_of_total_buffers);
+    if(!(write_req = (uv_write_t *) malloc(bytes))){
+        memory_error("Unable to allocate buffer of size %d", bytes);
+    }
+
+    write_batch* batch = get_write_batch(write_req);
+    batch->buffers = (uv_buf_t*)(batch + 1);
+    batch->number_of_used_buffers = 0;
+    batch->number_of_total_buffers = number_of_total_buffers;
+    write_req->data = batch;
+
+    return write_req;
+}
+
+write_batch* get_write_batch(uv_write_t* write_req) {
+    write_batch* batch = (write_batch*)(write_req + 1);
+    return batch;
+}

+ 12 - 0
frameworks/C/octane/src/write_batch.h

@@ -0,0 +1,12 @@
+#pragma once
+#include <stdlib.h>
+#include <uv.h>
+
+typedef struct {
+    uv_buf_t* buffers;
+    size_t number_of_used_buffers;
+    size_t number_of_total_buffers;
+}write_batch;
+
+uv_write_t* create_write_with_batch(size_t number_of_total_buffers);
+write_batch* get_write_batch(uv_write_t* write_req);

+ 1 - 1
frameworks/C/onion/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends onion
+fw_depends mysql onion
 
 sed -i 's|127.0.0.1|'${DBHOST}'|g' hello.c
 

+ 5 - 5
frameworks/CSharp/aspnet/benchmark_config.json

@@ -272,7 +272,7 @@
       "versus": "aspnet-mono"
     },
     "mono-mysql-raw": {
-      "setup_file": "setup_nginx",
+      "setup_file": "setup_mysql",
       "json_url": "/json/default",
       "plaintext_url": "/plaintext",
       "db_url": "/ado/mysql",
@@ -296,7 +296,7 @@
       "versus": "aspnet"
     },
     "mono-postgresql-raw": {
-      "setup_file": "setup_nginx",
+      "setup_file": "setup_postgresql",
       "db_url": "/ado/postgresql",
       "query_url": "/ado/postgresql?queries=",
       "fortune_url": "/ado/postgresql/fortunes",
@@ -318,7 +318,7 @@
       "versus": "aspnet"
     },
     "mono-mongodb-raw": {
-      "setup_file": "setup_nginx",
+      "setup_file": "setup_mongodb",
       "db_url": "/mongodb",
       "query_url": "/mongodb?queries=",
       "fortune_url": "/mongodb/fortunes",
@@ -340,7 +340,7 @@
       "versus": "aspnet"
     },
     "mono-mysql-entityframework": {
-      "setup_file": "setup_nginx",
+      "setup_file": "setup_mysql",
       "db_url": "/entityframework/mysql",
       "query_url": "/entityframework/mysql?queries=",
       "fortune_url": "/entityframework/mysql/fortunes",
@@ -362,7 +362,7 @@
       "versus": "aspnet"
     },
     "mono-postgresql-entityframework": {
-      "setup_file": "setup_nginx",
+      "setup_file": "setup_postgresql",
       "db_url": "/entityframework/postgresql",
       "query_url": "/entityframework/postgresql?queries=",
       "fortune_url": "/entityframework/postgresql/fortunes",

+ 5 - 0
frameworks/CSharp/aspnet/setup_mongodb.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mongodb
+
+source ./setup_nginx.sh

+ 5 - 0
frameworks/CSharp/aspnet/setup_mysql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mysql
+
+source ./setup_nginx.sh

+ 5 - 0
frameworks/CSharp/aspnet/setup_postgresql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends postgresql
+
+source ./setup_nginx.sh

+ 2 - 0
frameworks/CSharp/aspnetcore/setup-dapper.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
+fw_depends postgresql
+
 source run-linux.sh dapper $(($(nproc)/2))

+ 2 - 0
frameworks/CSharp/aspnetcore/setup-ef.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
+fw_depends postgresql
+
 source run-linux.sh ef $(($(nproc)/2))

+ 2 - 0
frameworks/CSharp/aspnetcore/setup-raw.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
+fw_depends postgresql
+
 source run-linux.sh raw $(($(nproc)/2))

+ 1 - 1
frameworks/CSharp/nancy/setup_nginx.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends nginx mono
+fw_depends mysql nginx mono
 
 sed -i 's|localhost|'"${DBHOST}"'|g' src/Web.config
 sed -i 's|include /usr/local/nginx/conf/fastcgi_params;|include '"${NGINX_HOME}"'/conf/fastcgi_params;|g' nginx.conf

+ 1 - 1
frameworks/CSharp/revenj/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends java mono dsl_platform
+fw_depends postgresql java mono dsl_platform
 
 echo "Cleaning up..."
 rm -rf $TROOT/exe $TROOT/tmp $TROOT/dsl-clc.jar $TROOT/http-server.zip

+ 1 - 1
frameworks/CSharp/servicestack/setup_nginx.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends nginx mono
+fw_depends mysql postgresql mongodb nginx mono
 
 sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' nginx.conf

+ 1 - 1
frameworks/CSharp/servicestack/setup_xsp.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends nginx mono
+fw_depends mysql postgresql mongodb nginx mono
 
 sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
 # extra cleaning

+ 1 - 1
frameworks/Clojure/compojure/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends java resin leiningen
+fw_depends mysql java resin leiningen
 
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' hello/src/hello/handler.clj
 

+ 1 - 1
frameworks/Clojure/http-kit/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends leiningen java
+fw_depends mysql leiningen java
 
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' hello/src/hello/handler.clj
 

+ 1 - 1
frameworks/Clojure/luminus/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends java resin leiningen
+fw_depends postgresql java resin leiningen
 
 # Update db host in the source file
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' hello/env/prod/resources/config.edn

+ 1 - 1
frameworks/Clojure/pedestal/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends java leiningen
+fw_depends mysql java leiningen
 
 sed -i 's|127.0.0.1:3306|'${DBHOST}':3306|g' src/pedestal/service.clj
 

+ 1 - 1
frameworks/Crystal/kemal/setup-postgres.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends crystal
+fw_depends postgresql crystal
 
 shards install
 

+ 1 - 1
frameworks/D/vibed/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends dlang dub
+fw_depends mongodb dlang dub
 
 # Clean any files from last run
 rm -f fwb

+ 1 - 1
frameworks/D/vibed/setup_ldc.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends dlang dub
+fw_depends mongodb dlang dub
 
 # Clean any files from last run
 rm -f fwb

+ 1 - 1
frameworks/Dart/dart-raw/setup.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' postgresql.yaml
 
-fw_depends dart
+fw_depends postgresql dart
 
 pub upgrade
 

+ 2 - 2
frameworks/Dart/redstone/benchmark_config.json

@@ -2,7 +2,7 @@
   "framework": "redstone",
   "tests": [{
     "default": {
-      "setup_file": "setup",
+      "setup_file": "setup_postgresql",
       "json_url": "/json",
       "db_url": "/pg/db",
       "query_url": "/pg/queries?queries=",
@@ -26,7 +26,7 @@
       "versus": "dart"
     },
     "mongodb": {
-      "setup_file": "setup",
+      "setup_file": "setup_mongodb",
       "db_url": "/mongo/db",
       "query_url": "/mongo/queries?queries=",
       "fortune_url": "/mongo/fortunes",

+ 5 - 0
frameworks/Dart/redstone/setup_mongodb.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mongodb
+
+source ./setup.sh

+ 5 - 0
frameworks/Dart/redstone/setup_postgresql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends postgresql
+
+source ./setup.sh

+ 2 - 2
frameworks/Dart/start/benchmark_config.json

@@ -2,7 +2,7 @@
   "framework": "start",
   "tests": [{
     "default": { 
-      "setup_file": "setup",
+      "setup_file": "setup_postgresql",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -26,7 +26,7 @@
       "versus": "dart"
     },
     "mongodb-raw": {
-      "setup_file": "setup",
+      "setup_file": "setup_mongodb",
       "db_url": "/db-mongo",
       "query_url": "/queries-mongo?queries=",
       "fortune_url": "/fortunes-mongo",

+ 5 - 0
frameworks/Dart/start/setup_mongodb.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mongodb
+
+source ./setup.sh

+ 5 - 0
frameworks/Dart/start/setup_postgresql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends postgresql
+
+source ./setup.sh

+ 2 - 2
frameworks/Dart/stream/benchmark_config.json

@@ -2,7 +2,7 @@
   "framework": "stream",
   "tests": [{
     "default": {
-      "setup_file": "setup",
+      "setup_file": "setup_postgresql",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -26,7 +26,7 @@
       "versus": "dart"
     },
     "mongodb-raw": {
-      "setup_file": "setup",
+      "setup_file": "setup_mongodb",
       "db_url": "/db-mongo",
       "query_url": "/queries-mongo?queries=",
       "fortune_url": "/fortunes-mongo",

+ 5 - 0
frameworks/Dart/stream/setup_mongodb.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends mongodb
+
+source ./setup.sh

+ 5 - 0
frameworks/Dart/stream/setup_postgresql.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+fw_depends postgresql
+
+source ./setup.sh

+ 1 - 1
frameworks/Elixir/phoenix/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends elixir
+fw_depends postgresql elixir
 
 sed -i 's|localhost|'${DBHOST}'|g' config/prod.exs
 

+ 1 - 1
frameworks/Erlang/cowboy/setup.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|"benchmarkdbpass", ".*", 3306|"benchmarkdbpass", "'"${DBHOST}"'", 3306|g' src/hello_world_app.erl
 
-fw_depends erlang
+fw_depends mysql erlang
 
 rm -rf deps/* ebin/*
 rebar get-deps

+ 1 - 1
frameworks/Go/beego/setup.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/astaxie/beego
 go get github.com/go-sql-driver/mysql

+ 1 - 1
frameworks/Go/echo/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/labstack/echo/...
 go get github.com/lib/pq

+ 1 - 1
frameworks/Go/echo/setup_prefork.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends postgresql go
 
 go get github.com/labstack/echo/...
 go get github.com/lib/pq

+ 1 - 1
frameworks/Go/echo/setup_std.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends postgresql go
 
 go get github.com/labstack/echo/...
 go get github.com/lib/pq

+ 1 - 1
frameworks/Go/falcore/setup.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/framework_benchmarks/falcore.go
 
-fw_depends go
+fw_depends mysql go
 
 go get ./...
 go run src/framework_benchmarks/falcore.go &

+ 1 - 1
frameworks/Go/fasthttp/setup-mysql.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/server-mysql/server.go
 
-fw_depends go
+fw_depends mysql go
 
 GOPATH=`pwd` go get -u github.com/go-sql-driver/mysql
 GOPATH=`pwd` go get -u github.com/valyala/fasthttp/...

+ 1 - 1
frameworks/Go/fasthttp/setup-postgresql.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|localhost|'"${DBHOST}"'|g' src/server-postgresql/server.go
 
-fw_depends go
+fw_depends postgresql go
 
 GOPATH=`pwd` go get -u github.com/jackc/pgx
 GOPATH=`pwd` go get -u github.com/valyala/fasthttp/...

+ 1 - 1
frameworks/Go/gin/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/gin-gonic/gin
 go get github.com/go-sql-driver/mysql

+ 1 - 1
frameworks/Go/go-std/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/go-sql-driver/mysql
 

+ 1 - 1
frameworks/Go/go-std/setup_mongo.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|connectionString = "localhost"|connectionString = "'"${DBHOST}"'"|g' hello_mongo.go
 
-fw_depends go libsasl2-dev 
+fw_depends mongodb go libsasl2-dev 
 
 go get gopkg.in/mgo.v2
 

+ 1 - 1
frameworks/Go/go-std/setup_postgres.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends postgresql go
 
 go get github.com/lib/pq
 

+ 1 - 1
frameworks/Go/go-std/setup_prefork.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/go-sql-driver/mysql
 

+ 1 - 1
frameworks/Go/goji/setup.sh

@@ -2,7 +2,7 @@
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/goji/server.go
 
-fw_depends go
+fw_depends mysql go
 
 go get github.com/go-sql-driver/mysql
 go get github.com/zenazn/goji

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно