Browse Source

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

jamming 10 years ago
parent
commit
d24820cb2a
38 changed files with 533 additions and 147 deletions
  1. 11 10
      .travis.yml
  2. 1 1
      frameworks/Java/play2-java/install.sh
  3. 2 2
      frameworks/Java/play2-java/play2-java-ebean-bonecp/build.sbt
  4. 1 1
      frameworks/Java/play2-java/play2-java-ebean-bonecp/project/plugins.sbt
  5. 3 3
      frameworks/Java/play2-java/play2-java-ebean-hikaricp/build.sbt
  6. 46 18
      frameworks/Java/play2-java/play2-java-ebean-hikaricp/conf/application.conf
  7. 1 1
      frameworks/Java/play2-java/play2-java-ebean-hikaricp/project/plugins.sbt
  8. 3 3
      frameworks/Java/play2-java/play2-java-jpa-bonecp/build.sbt
  9. 1 1
      frameworks/Java/play2-java/play2-java-jpa-bonecp/project/plugins.sbt
  10. 4 4
      frameworks/Java/play2-java/play2-java-jpa-hikaricp/build.sbt
  11. 47 19
      frameworks/Java/play2-java/play2-java-jpa-hikaricp/conf/application.conf
  12. 1 1
      frameworks/Java/play2-java/play2-java-jpa-hikaricp/project/plugins.sbt
  13. 1 1
      frameworks/Java/play2-java/play2-java/build.sbt
  14. 1 1
      frameworks/Java/play2-java/play2-java/project/plugins.sbt
  15. 1 1
      frameworks/Java/play2-java/setup_java.sh
  16. 1 1
      frameworks/Java/play2-java/setup_java_ebean_bonecp.sh
  17. 1 1
      frameworks/Java/play2-java/setup_java_ebean_hikaricp.sh
  18. 1 1
      frameworks/Java/play2-java/setup_java_jpa_bonecp.sh
  19. 1 1
      frameworks/Java/play2-java/setup_java_jpa_hikaricp.sh
  20. 43 6
      frameworks/Java/vertx/README.md
  21. 139 38
      frameworks/Java/vertx/WebServer.java
  22. 1 1
      frameworks/Java/vertx/app.js
  23. 2 0
      frameworks/Java/vertx/benchmark_config.json
  24. 1 1
      frameworks/Java/vertx/install.sh
  25. 51 21
      frameworks/Lua/openresty/app.lua
  26. 2 1
      frameworks/Lua/openresty/benchmark_config.json
  27. 3 1
      frameworks/Lua/openresty/install.sh
  28. 11 2
      frameworks/Lua/openresty/nginx.conf
  29. 25 4
      frameworks/PHP/php-laravel/deploy/nginx.conf
  30. 8 0
      frameworks/Scala/colossus/.gitignore
  31. 30 0
      frameworks/Scala/colossus/README.md
  32. 23 0
      frameworks/Scala/colossus/benchmark_config.json
  33. 14 0
      frameworks/Scala/colossus/build.sbt
  34. 3 0
      frameworks/Scala/colossus/install.sh
  35. 1 0
      frameworks/Scala/colossus/project/plugins.sbt
  36. 9 0
      frameworks/Scala/colossus/setup.sh
  37. 38 0
      frameworks/Scala/colossus/src/main/scala/example/Main.scala
  38. 1 1
      frameworks/Ur/urweb/install.sh

+ 11 - 10
.travis.yml

@@ -1,5 +1,5 @@
 language: python
-python: 
+python:
   - "2.7"
 
 env:
@@ -9,12 +9,12 @@ env:
     # 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 
+    # 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 
+    #   cd frameworks
     #   find . -type d -depth 2 | sed 's|./|    - "TESTDIR=|' | sed 's/$/"/g'
     #
-    #  
+    #
     - "TESTDIR=C/lwan"
     - "TESTDIR=C/duda"
     - "TESTDIR=C/haywire"
@@ -142,6 +142,7 @@ env:
     - "TESTDIR=Ruby/rails"
     - "TESTDIR=Ruby/rails-stripped"
     - "TESTDIR=Ruby/sinatra"
+    - "TESTDIR=Scala/colossus"
     - "TESTDIR=Scala/finagle"
     - "TESTDIR=Scala/lift-stateless"
     - "TESTDIR=Scala/plain"
@@ -155,7 +156,7 @@ env:
     - "TESTDIR=Ur/urweb"
 
 before_install:
-  # Need to install python modules before using 
+  # Need to install python modules before using
   # python
   - pip install -r requirements.txt
 
@@ -164,15 +165,15 @@ before_install:
   - ./toolset/run-ci.py cisetup "$TESTDIR"
 
 addons:
-  postgresql: "9.3" 
+  postgresql: "9.3"
 
 install:
   # Install prerequisites
   - ./toolset/run-ci.py prereq "$TESTDIR"
-  
-  # Install software for this framework  
+
+  # Install software for this framework
   - ./toolset/run-ci.py install "$TESTDIR"
-   
-script: 
+
+script:
   # Pick one test in this directory and verify
   - time ./toolset/run-ci.py verify "$TESTDIR"

+ 1 - 1
frameworks/Java/play2-java/install.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-fw_depends java7 sbt
+fw_depends java8 sbt

+ 2 - 2
frameworks/Java/play2-java/play2-java-ebean-bonecp/build.sbt

@@ -4,10 +4,10 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayJava)
 
-scalaVersion := "2.11.4"
+scalaVersion := "2.11.6"
 
 libraryDependencies ++= Seq(
   javaJdbc,
   javaEbean,
-  "mysql" % "mysql-connector-java" % "5.1.33"
+  "mysql" % "mysql-connector-java" % "5.1.35"
 )

+ 1 - 1
frameworks/Java/play2-java/play2-java-ebean-bonecp/project/plugins.sbt

@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

+ 3 - 3
frameworks/Java/play2-java/play2-java-ebean-hikaricp/build.sbt

@@ -4,13 +4,13 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayJava)
 
-scalaVersion := "2.11.4"
+scalaVersion := "2.11.6"
 
 libraryDependencies ++= Seq(
   javaJdbc,
   javaEbean,
-  "mysql" % "mysql-connector-java" % "5.1.33",
-  "com.edulify" %% "play-hikaricp" % "1.5.0"
+  "mysql" % "mysql-connector-java" % "5.1.35",
+  "com.edulify" %% "play-hikaricp" % "2.0.4"
 )
 
 resolvers += Resolver.url("Edulify Repository", url("http://edulify.github.io/modules/releases/"))(Resolver.ivyStylePatterns)

+ 46 - 18
frameworks/Java/play2-java/play2-java-ebean-hikaricp/conf/application.conf

@@ -29,25 +29,53 @@ application.langs="en"
 #
 # You can expose this datasource via JNDI if needed (Useful for JPA)
 # db.default.jndiName=DefaultDS
-db.default.driver= com.mysql.jdbc.Driver
-db.default.url="jdbc:mysql://127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
-db.default.user=benchmarkdbuser
-db.default.password=benchmarkdbpass
-db.default.jndiName=DefaultDS
 
-db.default.partitionCount=4
-
-# The number of connections to create per partition. Setting this to 
-# 5 with 3 partitions means you will have 15 unique connections to the 
-# database.
-
-# This value maps to the maximumPoolSize for HickariCP (db.default.partitionCount * db.default.maxConnectionsPerPartition)
-db.default.maxConnectionsPerPartition=64
-
-# The number of initial connections, per partition.
-#
-# This maps to the minimumIdle connections for HikariCP (db.default.partitionCount * db.default.minConnectionsPerPartition)
-db.default.minConnectionsPerPartition=64
+db {
+  default {
+
+    jndiName="DefaultDS"
+
+    dataSourceClassName=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+    dataSource {
+      user=benchmarkdbuser
+      password=benchmarkdbpass
+      databaseName=hello_world
+      serverName=127.0.0.1
+      port=3306
+
+      jdbcCompliantTruncation=false
+      elideSetAutoCommits=true
+      useLocalSessionState=true
+      cachePrepStmts=true
+      cacheCallableStmts=true
+      cacheServerConfiguration=true
+      cacheResultSetMetadata=true
+      alwaysSendSetIsolation=false
+      prepStmtCacheSize=4096
+      prepStmtCacheSqlLimit=2048
+      zeroDateTimeBehavior=convertToNull
+      traceProtocol=false
+      useUnbufferedInput=false
+      useReadAheadInput=false
+      maintainTimeStats=false
+      useServerPrepStmts=true
+    }
+
+    partitionCount=4
+
+    # The number of connections to create per partition. Setting this to
+    # 5 with 3 partitions means you will have 15 unique connections to the
+    # database.
+
+    # This value maps to the maximumPoolSize for HickariCP (db.default.partitionCount * db.default.maxConnectionsPerPartition)
+    maxConnectionsPerPartition=64
+
+    # The number of initial connections, per partition.
+    #
+    # This maps to the minimumIdle connections for HikariCP (db.default.partitionCount * db.default.minConnectionsPerPartition)
+    minConnectionsPerPartition=64
+  }
+}
 
 dbplugin=disabled
 

+ 1 - 1
frameworks/Java/play2-java/play2-java-ebean-hikaricp/project/plugins.sbt

@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

+ 3 - 3
frameworks/Java/play2-java/play2-java-jpa-bonecp/build.sbt

@@ -2,15 +2,15 @@ name := "play2-java-jpa-bonecp"
 
 version := "1.0-SNAPSHOT"
 
-scalaVersion := "2.11.4"
+scalaVersion := "2.11.6"
 
 lazy val root = (project in file(".")).enablePlugins(PlayJava)
 
 libraryDependencies ++= Seq(
   javaJdbc,
   javaJpa,
-  "mysql" % "mysql-connector-java" % "5.1.33",
-  "org.hibernate" % "hibernate-entitymanager" % "4.3.6.Final"
+  "mysql" % "mysql-connector-java" % "5.1.35",
+  "org.hibernate" % "hibernate-entitymanager" % "4.3.9.Final"
   )
 
 dependencyOverrides += "com.jolbox" % "bonecp" % "0.8.0.RELEASE"

+ 1 - 1
frameworks/Java/play2-java/play2-java-jpa-bonecp/project/plugins.sbt

@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

+ 4 - 4
frameworks/Java/play2-java/play2-java-jpa-hikaricp/build.sbt

@@ -4,14 +4,14 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayJava)
 
-scalaVersion := "2.11.4"
+scalaVersion := "2.11.6"
 
 libraryDependencies ++= Seq(
   javaJdbc,
   javaJpa,
-  "mysql" % "mysql-connector-java" % "5.1.33",
-  "org.hibernate" % "hibernate-entitymanager" % "4.3.6.Final",
-  "com.edulify" %% "play-hikaricp" % "1.5.0"
+  "mysql" % "mysql-connector-java" % "5.1.35",
+  "org.hibernate" % "hibernate-entitymanager" % "4.3.9.Final",
+  "com.edulify" %% "play-hikaricp" % "2.0.4"
 )
 
 resolvers += Resolver.url("Edulify Repository", url("http://edulify.github.io/modules/releases/"))(Resolver.ivyStylePatterns)

+ 47 - 19
frameworks/Java/play2-java/play2-java-jpa-hikaricp/conf/application.conf

@@ -44,26 +44,54 @@ application.langs="en"
 # You can expose this datasource via JNDI if needed (Useful for JPA)
 # db.default.jndiName=DefaultDS
 
-db.default.driver= com.mysql.jdbc.Driver
-db.default.url="jdbc:mysql://127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
-db.default.user=benchmarkdbuser
-db.default.password=benchmarkdbpass
-db.default.jndiName=DefaultDS
-jpa.default=defaultPersistenceUnit
-
-db.default.partitionCount=4
-
-# The number of connections to create per partition. Setting this to
-# 5 with 3 partitions means you will have 15 unique connections to the
-# database..
-#
-# This value maps to the maximumPoolSize for HickariCP (db.default.partitionCount * db.default.maxConnectionsPerPartition)
-db.default.maxConnectionsPerPartition=64
+db {
+  default {
+
+    jndiName="DefaultDS"
+
+    dataSourceClassName=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+    dataSource {
+      user=benchmarkdbuser
+      password=benchmarkdbpass
+      databaseName=hello_world
+      serverName=127.0.0.1
+      port=3306
+
+      jdbcCompliantTruncation=false
+      elideSetAutoCommits=true
+      useLocalSessionState=true
+      cachePrepStmts=true
+      cacheCallableStmts=true
+      cacheServerConfiguration=true
+      cacheResultSetMetadata=true
+      alwaysSendSetIsolation=false
+      prepStmtCacheSize=4096
+      prepStmtCacheSqlLimit=2048
+      zeroDateTimeBehavior=convertToNull
+      traceProtocol=false
+      useUnbufferedInput=false
+      useReadAheadInput=false
+      maintainTimeStats=false
+      useServerPrepStmts=true
+    }
+
+    partitionCount=4
+
+    # The number of connections to create per partition. Setting this to
+    # 5 with 3 partitions means you will have 15 unique connections to the
+    # database.
+
+    # This value maps to the maximumPoolSize for HickariCP (db.default.partitionCount * db.default.maxConnectionsPerPartition)
+    maxConnectionsPerPartition=64
+
+    # The number of initial connections, per partition.
+    #
+    # This maps to the minimumIdle connections for HikariCP (db.default.partitionCount * db.default.minConnectionsPerPartition)
+    minConnectionsPerPartition=64
+  }
+}
 
-# The number of initial connections, per partition.
-#
-# This maps to the minimumIdle connections for HikariCP (db.default.partitionCount * db.default.minConnectionsPerPartition)
-db.default.minConnectionsPerPartition=64
+jpa.default=defaultPersistenceUnit
 
 dbplugin=disabled
 

+ 1 - 1
frameworks/Java/play2-java/play2-java-jpa-hikaricp/project/plugins.sbt

@@ -1,4 +1,4 @@
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 // The Play plugin
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

+ 1 - 1
frameworks/Java/play2-java/play2-java/build.sbt

@@ -4,4 +4,4 @@ version := "1.0-SNAPSHOT"
 
 lazy val root = (project in file(".")).enablePlugins(PlayJava)
 
-scalaVersion := "2.11.4"
+scalaVersion := "2.11.6"

+ 1 - 1
frameworks/Java/play2-java/play2-java/project/plugins.sbt

@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

+ 1 - 1
frameworks/Java/play2-java/setup_java.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # load java environment variables
-source $IROOT/java7.installed
+source $IROOT/java8.installed
 
 cd play2-java
 

+ 1 - 1
frameworks/Java/play2-java/setup_java_ebean_bonecp.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # load java environment variables
-source $IROOT/java7.installed
+source $IROOT/java8.installed
 
 cd play2-java-ebean-bonecp
 

+ 1 - 1
frameworks/Java/play2-java/setup_java_ebean_hikaricp.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # load java environment variables
-source $IROOT/java7.installed
+source $IROOT/java8.installed
 
 cd play2-java-ebean-hikaricp
 

+ 1 - 1
frameworks/Java/play2-java/setup_java_jpa_bonecp.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # load java environment variables
-source $IROOT/java7.installed
+source $IROOT/java8.installed
 
 cd play2-java-jpa-bonecp
 

+ 1 - 1
frameworks/Java/play2-java/setup_java_jpa_hikaricp.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # load java environment variables
-source $IROOT/java7.installed
+source $IROOT/java8.installed
 
 cd play2-java-jpa-hikaricp
 

+ 43 - 6
frameworks/Java/vertx/README.md

@@ -1,22 +1,43 @@
-# Vertx Benchmarking Test
+# Vertx 2.x Benchmarking Test
 
-This is the vertx portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+This is the vertx 2.x portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+### Plaintext Test
+
+* [Plaintext test source](WebServer.java)
+
+### JSON Serialization Test
 
-### JSON Encoding Test
 * [JSON test source](WebServer.java)
 
-### Data-Store/Database Mapping Test
+### Database Single query Test
+
+* [Database Single query test source](WebServer.java)
+
+### Database Multiple queries Test
+
+* [Database Multiple queries test source](WebServer.java)
+
+### Database Data updates Test
+
+* [Database Data updates test source](WebServer.java)
+
+### Fortunes Test
 
-* [Database test source](WebServer.java)
+* [Fortunes test source](WebServer.java)
 
 ## Versions
 
-* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
+* [Java OpenJDK 1.7.0_79](http://openjdk.java.net/)
 * [vertx 2.1.5](http://vertx.io/)
 
 
 ## Test URLs
 
+### Plaintext Test
+
+    http://localhost:8080/plaintext
+
 ### JSON Encoding Test
 
     http://localhost:8080/json
@@ -24,3 +45,19 @@ This is the vertx portion of a [benchmarking test suite](../) comparing a variet
 ### Database Mapping Test
 
     http://localhost:8080/db?queries=5
+
+### Database Single query Test
+
+    http://localhost:8080/db
+
+### Database Multiple queries Test
+
+    http://localhost:8080/queries?queries=5
+
+### Database Data updates Test
+
+    http://localhost:8080/updates?queries=3
+
+### Fortunes Test
+
+    http://localhost:8080/fortunes

+ 139 - 38
frameworks/Java/vertx/WebServer.java

@@ -15,38 +15,67 @@ import java.util.Date;
 import java.util.Random;
 import java.util.concurrent.ThreadLocalRandom;
 
+import freemarker.template.Template;
+import freemarker.template.Configuration;
+import java.io.StringReader;
+import java.io.Writer;
+import java.io.StringWriter;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+
 public class WebServer extends Verticle implements Handler<HttpServerRequest> {
 
   private final Buffer helloWorldBuffer = new Buffer("Hello, World!");
   private final String helloWorldContentLength = String.valueOf(helloWorldBuffer.length());
   private final DateFormat DATE_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyyy HH:mm:ss z");
+  private final Random random = ThreadLocalRandom.current();
   private String dateString;
 
-  private final String PATH_PLAINTEXT = "/plaintext";
-  private final String PATH_JSON = "/json";
-  private final String PATH_DB = "/db";
-  private final String PATH_QUERIES = "/queries";
-  private final String RESPONSE_TYPE_PLAIN = "text/plain";
-  private final String RESPONSE_TYPE_JSON = "application/json";
-  private final String HEADER_CONTENT_TYPE = "Content-Type";
-  private final String HEADER_CONTENT_LENGTH = "Content-Length";
-  private final String HEADER_SERVER = "Server";
-  private final String HEADER_SERVER_VERTX = "vert.x";
-  private final String HEADER_DATE = "Date";
-  private final String MONGO_ADDRESS = "hello.persistor";
-  private final String UNDERSCORE_ID = "_id";
-  private final String TEXT_ID = "id";
-  private final String TEXT_RESULT = "result";
-  private final String TEXT_QUERIES = "queries";
-  private final String TEXT_MESSAGE = "message";
-  private final String TEXT_ACTION = "action";
-  private final String TEXT_FINDONE = "findone";
-  private final String TEXT_COLLECTION = "collection";
-  private final String TEXT_WORLD = "World";
-  private final String TEXT_MATCHER = "matcher";
+  private static final String PATH_PLAINTEXT = "/plaintext";
+  private static final String PATH_JSON = "/json";
+  private static final String PATH_DB = "/db";
+  private static final String PATH_QUERIES = "/queries";
+  private static final String PATH_UPDATES = "/updates";
+  private static final String PATH_FORTUNES = "/fortunes";
+  private static final String RESPONSE_TYPE_PLAIN = "text/plain";
+  private static final String RESPONSE_TYPE_HTML = "text/html";
+  private static final String RESPONSE_TYPE_JSON = "application/json";
+  private static final String HEADER_CONTENT_TYPE = "Content-Type";
+  private static final String HEADER_CONTENT_LENGTH = "Content-Length";
+  private static final String HEADER_SERVER = "Server";
+  private static final String HEADER_SERVER_VERTX = "vert.x";
+  private static final String HEADER_DATE = "Date";
+  private static final String MONGO_ADDRESS = "hello.persistor";
+  private static final String FREEMARKER_ADDRESS = "vertx.freemarker";
+  private static final String UNDERSCORE_ID = "_id";
+  private static final String TEXT_ID = "id";
+  private static final String RANDOM_NUMBER = "randomNumber";
+  private static final String TEXT_RESULT = "result";
+  private static final String TEXT_RESULTS = "results";
+  private static final String TEXT_QUERIES = "queries";
+  private static final String TEXT_MESSAGE = "message";
+  private static final String TEXT_MESSAGES = "messages";
+  private static final String ADD_FORTUNE_MESSAGE = "Additional fortune added at request time.";
+  private static final String HELLO_WORLD = "Hello, world!";
+  private static final String TEXT_ACTION = "action";
+  private static final String TEXT_CRITERIA = "criteria";
+  private static final String TEXT_UPDATE = "update";
+  private static final String TEXT_OBJ_NEW = "objNew";
+  private static final String TEXT_FINDONE = "findone";
+  private static final String TEXT_FIND = "find";
+  private static final String TEXT_COLLECTION = "collection";
+  private static final String TEXT_WORLD = "World";
+  private static final String TEXT_FORTUNE = "Fortune";
+  private static final String TEXT_MATCHER = "matcher";
+  private static final String TEMPLATE_FORTUNE = "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><#list messages as message><tr><td>${message.id?html}</td><td>${message.message?html}</td></tr></#list></table></body></html>";
+  
+  private Template ftlTemplate;
 
   @Override
   public void start() {
+    try { ftlTemplate = new Template(TEXT_FORTUNE, new StringReader(TEMPLATE_FORTUNE), new Configuration(Configuration.VERSION_2_3_22)); } catch (Exception ex) { ex.printStackTrace(); }
     vertx.createHttpServer().requestHandler(WebServer.this).listen(8080);
     vertx.setPeriodic(1000, new Handler<Long>() {
       @Override
@@ -70,7 +99,13 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
         handleDbMongo(req);
         break;
       case PATH_QUERIES:
-        handleQueriesMongo(req);
+        handleDBMongo(req,false);
+        break;
+      case PATH_UPDATES:
+        handleDBMongo(req,true);
+        break;
+      case PATH_FORTUNES:
+        handleFortunes(req);
         break;
       default:
         req.response().setStatusCode(404);
@@ -82,6 +117,40 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
     dateString = DATE_FORMAT.format(new Date());
   }
 
+  private void handleFortunes(HttpServerRequest req) {
+    final HttpServerResponse resp = req.response();
+    
+    vertx.eventBus().send(
+      MONGO_ADDRESS,
+      new JsonObject()
+          .putString(TEXT_ACTION, TEXT_FIND)
+          .putString(TEXT_COLLECTION, TEXT_FORTUNE),
+      new Handler<Message<JsonObject>>() {
+        @Override
+        public void handle(Message<JsonObject> reply) {
+          JsonArray results = reply.body().getArray(TEXT_RESULTS);
+          
+          List<Fortune> fortunes = new ArrayList<>();
+          for (Object fortune: results) {
+            fortunes.add(new Fortune(
+              ((JsonObject)fortune).getNumber(TEXT_ID).intValue(),
+              ((JsonObject)fortune).getString(TEXT_MESSAGE)));
+          }            
+          fortunes.add(new Fortune(0, ADD_FORTUNE_MESSAGE));
+          Collections.sort(fortunes);
+
+          Map model = new HashMap();
+          model.put(TEXT_MESSAGES, fortunes);
+          Writer writer = new StringWriter();
+          try { ftlTemplate.process(model, writer); } catch (Exception ex) { ex.printStackTrace(); }
+
+          Buffer buff = new Buffer(writer.toString());
+          setHeaders(resp, RESPONSE_TYPE_HTML, String.valueOf(buff.length()));
+          resp.end(buff);
+        }  
+    });
+  }
+
   private void handlePlainText(HttpServerRequest req) {
     HttpServerResponse resp = req.response();
     setHeaders(resp, RESPONSE_TYPE_PLAIN, helloWorldContentLength);
@@ -89,14 +158,14 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
   }
 
   private void handleJson(HttpServerRequest req) {
-    Buffer buff = new Buffer(Json.encode(Collections.singletonMap(TEXT_MESSAGE, "Hello, world!")));
+    Buffer buff = new Buffer(Json.encode(Collections.singletonMap(TEXT_MESSAGE, HELLO_WORLD)));
     HttpServerResponse resp = req.response();
     setHeaders(resp, RESPONSE_TYPE_JSON, String.valueOf(buff.length()));
     resp.end(buff);
   }
 
   private void handleDbMongo(final HttpServerRequest req) {
-    findRandom(ThreadLocalRandom.current(), new Handler<Message<JsonObject>>() {
+    findRandom(new Handler<Message<JsonObject>>() {
       @Override
       public void handle(Message<JsonObject> reply) {
         JsonObject world = getResultFromReply(reply);
@@ -110,15 +179,11 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
     JsonObject body = reply.body();
     JsonObject world = body.getObject(TEXT_RESULT);
     Object id = world.removeField(UNDERSCORE_ID);
-    if (id instanceof Double) {
-		world.putValue(TEXT_ID, Integer.valueOf(((Double)id).intValue()));
-	} else {
-		world.putValue(TEXT_ID, id);
-	}
+    world.putValue(TEXT_ID, Integer.valueOf(((Double)id).intValue()));
     return world;
   }
 
-  private void handleQueriesMongo(final HttpServerRequest req) {
+  private void handleDBMongo(final HttpServerRequest req, boolean randomUpdates) {
     int queriesParam = 1;
     try {
       queriesParam = Integer.parseInt(req.params().get(TEXT_QUERIES));
@@ -130,14 +195,13 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
     } else if (queriesParam > 500) {
       queriesParam = 500;
     }
-    final MongoHandler dbh = new MongoHandler(req, queriesParam);
-    final Random random = ThreadLocalRandom.current();
+    final MongoHandler dbh = new MongoHandler(req, queriesParam, randomUpdates);
     for (int i = 0; i < queriesParam; i++) {
-      findRandom(random, dbh);
+      findRandom(dbh);
     }
   }
 
-  private void findRandom(Random random, Handler<Message<JsonObject>> handler) {
+  private void findRandom(Handler<Message<JsonObject>> handler) {
     vertx.eventBus().send(
         MONGO_ADDRESS,
         new JsonObject()
@@ -147,6 +211,17 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
         handler);
   }
 
+  private void updateRandom(JsonObject json) {
+    vertx.eventBus().send(
+        MONGO_ADDRESS,
+        new JsonObject()
+            .putString(TEXT_ACTION, TEXT_UPDATE)
+            .putString(TEXT_COLLECTION, TEXT_WORLD)
+            .putObject(TEXT_CRITERIA, new JsonObject().putValue(UNDERSCORE_ID, json.getValue(TEXT_ID)))
+            .putObject(TEXT_OBJ_NEW, json)
+             );
+  }
+
   private void sendResponse(HttpServerRequest req, String result) {
     Buffer buff = new Buffer(result);
     HttpServerResponse resp = req.response();
@@ -161,20 +236,27 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
     resp.putHeader(HEADER_DATE, dateString);
   }
 
-  private class MongoHandler implements Handler<Message<JsonObject>> {
+  private final class MongoHandler implements Handler<Message<JsonObject>> {
     private final HttpServerRequest req;
     private final int queries;
     private final JsonArray worlds;
+    private final Random random;
+    private final boolean randomUpdates;
 
-    public MongoHandler(HttpServerRequest request, int queriesParam) {
+    public MongoHandler(HttpServerRequest request, int queriesParam, boolean performRandomUpdates) {
       req = request;
       queries = queriesParam;
+      randomUpdates = performRandomUpdates;
+      random = ThreadLocalRandom.current();
       worlds = new JsonArray();
     }
-
     @Override
     public void handle(Message<JsonObject> reply) {
       JsonObject world = getResultFromReply(reply);
+      if (randomUpdates) {
+        world.putValue(RANDOM_NUMBER, (random.nextInt(10000) + 1));
+        updateRandom(world);        
+      }
       worlds.add(world);
       if (worlds.size() == this.queries) {
         // All queries have completed; send the response.
@@ -183,6 +265,25 @@ public class WebServer extends Verticle implements Handler<HttpServerRequest> {
       }
     }
   }
+  
+  public final class Fortune implements Comparable<Fortune> {
+    public int id;
+    public String message;
 
+    public int getId() {
+      return id;
+    }
+    public String getMessage() {
+      return message;
+    }
+    public Fortune(int id, String message) {
+      this.id = id;
+      this.message = message;
+    }
+    @Override
+    public int compareTo(Fortune other) {
+      return message.compareTo(other.message);
+    }
+  }  
 }
 

+ 1 - 1
frameworks/Java/vertx/app.js

@@ -4,7 +4,7 @@ var persistorConf = {
   address: 'hello.persistor',
   db_name: 'hello_world',
   host: '127.0.0.1',
-  pool_size: 20
+  pool_size: 100
 }
 
 container.deployModule('io.vertx~mod-mongo-persistor~2.1.1', persistorConf, function (err, dep_id) {

+ 2 - 0
frameworks/Java/vertx/benchmark_config.json

@@ -7,6 +7,8 @@
       "db_url": "/db",
       "plaintext_url": "/plaintext",
       "query_url": "/queries?queries=",
+      "update_url": "/updates?queries=",
+      "fortune_url": "/fortunes",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",

+ 1 - 1
frameworks/Java/vertx/install.sh

@@ -7,5 +7,5 @@ RETCODE=$(fw_exists ${IROOT}/vert.x-2.1.5.installed)
 
 fw_get http://dl.bintray.com/vertx/downloads/vert.x-2.1.5.tar.gz?direct=true -O vert.x-2.1.5.tar.gz
 fw_untar vert.x-2.1.5.tar.gz
-
+wget http://central.maven.org/maven2/org/freemarker/freemarker/2.3.22/freemarker-2.3.22.jar -O ${IROOT}/vert.x-2.1.5/lib/freemarker-2.3.22.jar
 touch ${IROOT}/vert.x-2.1.5.installed

+ 51 - 21
frameworks/Lua/openresty/app.lua

@@ -3,6 +3,12 @@ local mysql = mysql
 local encode = encode
 local random = math.random
 local min = math.min
+local insert = table.insert
+local sort = table.sort
+local template = require'resty.template'
+template.caching(false)
+-- Compile template, disable cache, enable plain text view to skip filesystem loading
+local view = template.compile([[<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>{% for _,f in ipairs(fortunes) do %}<tr><td>{{ f.id }}</td><td>{{ f.message }}</td></tr>{% end %}</table></body></html>]], nil, true)
 
 local mysqlconn = {
 	host = "DBHOSTNAME",
@@ -11,24 +17,48 @@ local mysqlconn = {
 	user = "benchmarkdbuser",
 	password = "benchmarkdbpass"
 }
-return function(ngx)
-	local db = mysql:new()
-	assert(db:connect(mysqlconn))
-	local num_queries = tonumber(ngx.var.arg_queries) or 1
-	-- May seem like a stupid branch, but since we know that
-	-- at a benchmark it will always be taken one way,
-	-- it doesn't matter. For me, after a small warmup, the performance
-	-- is identical to a version without the branch
-	-- http://wiki.luajit.org/Numerical-Computing-Performance-Guide
-	if num_queries == 1 then
-		ngx.print(encode(db:query('SELECT * FROM World WHERE id = '..random(1,10000))[1]))
-	else
-		local worlds = {}
-		num_queries = min(500, num_queries)
-		for i=1, num_queries do
-			worlds[#worlds+1] = db:query('SELECT * FROM World WHERE id = '..random(1,10000))[1]
-		end
-		ngx.print( encode(worlds) )
-	end
-	db:set_keepalive(0, 256)
-end
+return {
+    db = function(ngx)
+        local db = mysql:new()
+        assert(db:connect(mysqlconn))
+        ngx.print(encode(db:query('SELECT * FROM World WHERE id = '..random(1,10000))[1]))
+        db:set_keepalive(0, 256)
+    end,
+    queries = function(ngx)
+        local db = mysql:new()
+        assert(db:connect(mysqlconn))
+        local num_queries = tonumber(ngx.var.arg_queries) or 1
+        -- May seem like a stupid branch, but since we know that
+        -- at a benchmark it will always be taken one way,
+        -- it doesn't matter. For me, after a small warmup, the performance
+        -- is identical to a version without the branch
+        -- http://wiki.luajit.org/Numerical-Computing-Performance-Guide
+        if num_queries < 2 then
+            ngx.print(encode({db:query('SELECT * FROM World WHERE id = '..random(1,10000))[1]}))
+        else
+            local worlds = {}
+            num_queries = min(500, num_queries)
+            for i=1, num_queries do
+                worlds[#worlds+1] = db:query('SELECT * FROM World WHERE id = '..random(1,10000))[1]
+            end
+            ngx.print( encode(worlds) )
+        end
+        db:set_keepalive(0, 256)
+    end,
+    fortunes = function(ngx)
+        local db = mysql:new()
+        assert(db:connect(mysqlconn))
+        local fortunes = db:query('SELECT * FROM Fortune')
+        insert(fortunes, {
+            id = 0,
+            message = "Additional fortune added at request time."
+        })
+        sort(fortunes, function(a, b)
+            return a.message < b.message
+        end)
+        local res = view{fortunes=fortunes}
+        ngx.header['Content-Length'] = #res
+        ngx.print(res)
+        db:set_keepalive(0, 256)
+    end
+}

+ 2 - 1
frameworks/Lua/openresty/benchmark_config.json

@@ -5,7 +5,8 @@
       "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
-      "query_url": "/db?queries=",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortunes",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",

+ 3 - 1
frameworks/Lua/openresty/install.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
-fw_depends lua nginx openresty 
+fw_depends lua openresty
+
+sudo luarocks install --server=http://rocks.moonscript.org lua-resty-template

+ 11 - 2
frameworks/Lua/openresty/nginx.conf

@@ -9,7 +9,7 @@ http {
     resolver 127.0.0.1;
     access_log off;
     lua_package_path 'CWD/?.lua;;';
-    init_by_lua 'jit.opt.start("minstitch=10"); require "resty.core" encode = require("cjson").encode mysql = require("resty.mysql")';
+    init_by_lua 'jit.opt.start("minstitch=10"); require "resty.core" encode = require("cjson").encode mysql = require("resty.mysql") app = require("app")';
     server {
         listen       8080;
         location /plaintext {
@@ -21,8 +21,17 @@ http {
             default_type "application/json";
             content_by_lua 'ngx.print(encode({message = "Hello, World!"}))';
         }
+        location /fortunes {
+            default_type "text/html; charset=UTF-8";
+            content_by_lua 'app.fortunes(ngx)';
+        }
+        location /db {
+            default_type "application/json";
+            content_by_lua 'app.db(ngx)';
+        }
         location / {
-            content_by_lua 'require("app")(ngx)';
+            default_type "application/json";
+            content_by_lua 'app.queries(ngx)';
         }
     }
 }

+ 25 - 4
frameworks/PHP/php-laravel/deploy/nginx.conf

@@ -1,7 +1,9 @@
 worker_processes  8;
 
 events {
-    worker_connections  1024;
+    worker_connections 2048;
+	multi_accept on;
+	use epoll;
 }
 
 http {
@@ -9,8 +11,27 @@ http {
     default_type  application/octet-stream;
     access_log off;
 
-    sendfile        on;
-    keepalive_timeout  65;
+    sendfile on;
+    tcp_nopush on;
+    tcp_nodelay on;
+    keepalive_timeout 65;
+	
+    open_file_cache max=2000 inactive=20s;
+    open_file_cache_valid 60s;
+    open_file_cache_min_uses 5;
+    open_file_cache_errors off; 
+
+    #FastCGI optimizations
+    fastcgi_buffers 256 16k;
+    fastcgi_buffer_size 128k;
+    fastcgi_connect_timeout 30s;
+    fastcgi_send_timeout 60s;
+    fastcgi_read_timeout 60s;
+    fastcgi_busy_buffers_size 256k;
+    fastcgi_temp_file_write_size 256k;
+    reset_timedout_connection on;
+    server_names_hash_bucket_size 100;
+	
 
     upstream fastcgi_backend {
         server 127.0.0.1:9001;
@@ -39,4 +60,4 @@ http {
             include        /home/vagrant/FrameworkBenchmarks/installs/nginx/conf/fastcgi_params;
         }
     }
-}
+}

+ 8 - 0
frameworks/Scala/colossus/.gitignore

@@ -0,0 +1,8 @@
+target/
+project/target
+bin/
+logs/
+.cache
+.classpath
+.project
+/bin/

+ 30 - 0
frameworks/Scala/colossus/README.md

@@ -0,0 +1,30 @@
+#colossus Benchmarking Test
+
+### JSON Encoding Test
+
+* [JSON test source](src/main/scala/example/Main.scala)
+
+### Plaintext Test
+
+* [JSON test source](src/main/scala/example/Main.scala)
+
+## Infrastructure Software Versions
+The tests were run with:
+
+* [Java Oracle 1.8.0_25](http://www.oracle.com/technetwork/java/javase)
+* [colossus 0.6.1](http://tumblr.github.io/colossus/)
+
+## Test URLs
+### JSON Encoding Test
+
+http://localhost:9007/json
+
+### Plaintext Test
+
+http://localhost:9007/plaintext
+
+## How to run
+sbt 'oneJar'
+
+java -jar target/scala-2.11/colossus*one-jar.jar
+

+ 23 - 0
frameworks/Scala/colossus/benchmark_config.json

@@ -0,0 +1,23 @@
+{
+  "framework": "colossus",
+  "tests": [{
+    "default": {
+      "orm": "Raw",
+      "database_os": "Linux",
+      "setup_file": "setup",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 9007,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "None",
+      "framework": "colossus",
+      "language": "Scala",
+      "platform": "Akka",
+      "webserver": "None",
+      "os": "Linux",
+      "display_name": "colossus",
+      "notes": ""
+    }
+  }]
+}

+ 14 - 0
frameworks/Scala/colossus/build.sbt

@@ -0,0 +1,14 @@
+name := """colossus-example"""
+
+version := "0.1.0"
+
+scalaVersion := "2.11.5"
+
+com.github.retronym.SbtOneJar.oneJarSettings
+
+mainClass in oneJar := Some("example.Main")
+
+libraryDependencies ++= Seq(
+  "com.tumblr" %% "colossus" % "0.6.1",
+  "net.liftweb" %% "lift-json" % "2.6-RC1"
+)

+ 3 - 0
frameworks/Scala/colossus/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends java8 sbt

+ 1 - 0
frameworks/Scala/colossus/project/plugins.sbt

@@ -0,0 +1 @@
+addSbtPlugin("org.scala-sbt.plugins" % "sbt-onejar" % "0.8")

+ 9 - 0
frameworks/Scala/colossus/setup.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+source $IROOT/java8.installed
+export SBT_HOME=${IROOT}/sbt
+
+${SBT_HOME}/bin/sbt 'oneJar'
+
+java -jar target/scala-2.11/colossus*one-jar.jar
+

+ 38 - 0
frameworks/Scala/colossus/src/main/scala/example/Main.scala

@@ -0,0 +1,38 @@
+package example
+
+import java.util.Date
+import java.text.SimpleDateFormat
+
+import colossus._
+import service._
+import protocols.http._
+import UrlParsing._
+import HttpMethod._
+
+import net.liftweb.json._
+import JsonDSL._
+
+object Main extends App {
+
+  implicit val io_system = IOSystem()
+
+  Service.become[Http]("sample", 9007) {
+    case request @ Get on Root / "json" => {
+      val json = ("message" -> "Hello, World!")
+      val sdf = new SimpleDateFormat("EEE, MMM d yyyy HH:MM:ss z")
+      val v = request.ok(compact(render(json)))
+        .withHeader("Content-Type", "application/json")
+        .withHeader("Server", "Colossus")
+        .withHeader("Date", sdf.format(new Date()))
+      Callback.successful(v)
+    }
+    case request @ Get on Root / "plaintext" => {
+      val sdf = new SimpleDateFormat("EEE, MMM d yyyy HH:MM:ss z")
+      val res = request.ok("Hello, World!")
+        .withHeader("Content-Type", "text/plain")
+        .withHeader("Server", "Colossus")
+        .withHeader("Date", sdf.format(new Date()))
+      Callback.successful(res)
+    }
+  }
+}

+ 1 - 1
frameworks/Ur/urweb/install.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VERSION=20150103
+VERSION=20150412
 COMPILER=${IROOT}/urweb
 
 RETCODE=$(fw_exists $COMPILER)