Browse Source

Upgrade http4k - add new backend implementation (#5686)

* add ktornetty module

* upgrade http4k, add ktornetty

* fix dockerfile

* Update README.md
David Denton 5 years ago
parent
commit
a45ef396a4

+ 2 - 3
frameworks/Kotlin/http4k/README.md

@@ -1,4 +1,4 @@
-#fintrospect Benchmarking Test
+#http4k Benchmarking Test
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 The tests were run with:
 The tests were run with:
@@ -7,7 +7,6 @@ The tests were run with:
 * [http4k](https://http4k.org)
 * [http4k](https://http4k.org)
 
 
 ## Test URLs
 ## Test URLs
-
 - JSON Encoding: http://localhost:9000/json
 - JSON Encoding: http://localhost:9000/json
 - Single query: http://localhost:9000/db
 - Single query: http://localhost:9000/db
 - Multiple queries: http://localhost:9000/queries
 - Multiple queries: http://localhost:9000/queries
@@ -15,10 +14,10 @@ The tests were run with:
 - Updates: http://localhost:9000/updates
 - Updates: http://localhost:9000/updates
 - Plaintext: http://localhost:9000/plaintext
 - Plaintext: http://localhost:9000/plaintext
 
 
-
 ## Supported backends
 ## Supported backends
 - Apache (w/ Postgres + Reactive PG clienta)
 - Apache (w/ Postgres + Reactive PG clienta)
 - KtorCIO (w/ Postgres client)
 - KtorCIO (w/ Postgres client)
+- KtorNetty (w/ Postgres client)
 - Jetty (w/ Postgres client)
 - Jetty (w/ Postgres client)
 - Netty (w/ Postgres client)
 - Netty (w/ Postgres client)
 - Undertow (w/ Postgres client)
 - Undertow (w/ Postgres client)

+ 21 - 0
frameworks/Kotlin/http4k/benchmark_config.json

@@ -106,6 +106,27 @@
         "os": "Linux",
         "os": "Linux",
         "notes": "",
         "notes": "",
         "versus": "ktor-cio"
         "versus": "ktor-cio"
+      },
+      "ktornetty": {
+        "orm": "Raw",
+        "database_os": "Linux",
+        "db_url": "/db",
+        "fortune_url": "/fortunes",
+        "query_url": "/queries?queries=",
+        "update_url": "/updates?queries=",
+        "database": "Postgres",
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "port": 9000,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "framework": "http4k",
+        "language": "Kotlin",
+        "platform": "ktornetty",
+        "webserver": "None",
+        "os": "Linux",
+        "notes": "",
+        "versus": "ktor-netty"
       }
       }
     }
     }
   ]
   ]

+ 3 - 2
frameworks/Kotlin/http4k/build.gradle

@@ -1,6 +1,6 @@
 buildscript {
 buildscript {
-    ext.kotlin_version = "1.3.61"
-    ext.http4k_version = "3.235.0"
+    ext.kotlin_version = "1.3.72"
+    ext.http4k_version = "3.247.0"
 
 
     repositories {
     repositories {
         mavenCentral()
         mavenCentral()
@@ -42,6 +42,7 @@ dependencies {
     compile project(":apache")
     compile project(":apache")
     compile project(":jetty")
     compile project(":jetty")
     compile project(":ktorcio")
     compile project(":ktorcio")
+    compile project(":ktornetty")
     compile project(":netty")
     compile project(":netty")
     compile project(":undertow")
     compile project(":undertow")
 }
 }

+ 1 - 0
frameworks/Kotlin/http4k/http4k-apache.dockerfile

@@ -7,6 +7,7 @@ COPY apache apache
 COPY core core
 COPY core core
 COPY jetty jetty
 COPY jetty jetty
 COPY ktorcio ktorcio
 COPY ktorcio ktorcio
+COPY ktornetty ktornetty
 COPY netty netty
 COPY netty netty
 COPY undertow undertow
 COPY undertow undertow
 RUN gradle --quiet build apache:shadowJar
 RUN gradle --quiet build apache:shadowJar

+ 1 - 0
frameworks/Kotlin/http4k/http4k-ktorcio.dockerfile

@@ -7,6 +7,7 @@ COPY apache apache
 COPY core core
 COPY core core
 COPY jetty jetty
 COPY jetty jetty
 COPY ktorcio ktorcio
 COPY ktorcio ktorcio
+COPY ktornetty ktornetty
 COPY netty netty
 COPY netty netty
 COPY undertow undertow
 COPY undertow undertow
 RUN gradle --quiet build ktorcio:shadowJar
 RUN gradle --quiet build ktorcio:shadowJar

+ 14 - 0
frameworks/Kotlin/http4k/http4k-ktornetty.dockerfile

@@ -0,0 +1,14 @@
+FROM gradle:5.4.1-jdk11
+USER root
+WORKDIR /http4k
+COPY build.gradle build.gradle
+COPY settings.gradle settings.gradle
+COPY apache apache
+COPY core core
+COPY jetty jetty
+COPY ktorcio ktorcio
+COPY ktornetty ktornetty
+COPY netty netty
+COPY undertow undertow
+RUN gradle --quiet build ktornetty:shadowJar
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-XX:+AlwaysPreTouch", "-jar", "ktornetty/build/libs/http4k-ktornetty-benchmark.jar"]

+ 1 - 0
frameworks/Kotlin/http4k/http4k-netty.dockerfile

@@ -7,6 +7,7 @@ COPY apache apache
 COPY core core
 COPY core core
 COPY jetty jetty
 COPY jetty jetty
 COPY ktorcio ktorcio
 COPY ktorcio ktorcio
+COPY ktornetty ktornetty
 COPY netty netty
 COPY netty netty
 COPY undertow undertow
 COPY undertow undertow
 RUN gradle --quiet build netty:shadowJar
 RUN gradle --quiet build netty:shadowJar

+ 1 - 0
frameworks/Kotlin/http4k/http4k-undertow.dockerfile

@@ -7,6 +7,7 @@ COPY apache apache
 COPY core core
 COPY core core
 COPY jetty jetty
 COPY jetty jetty
 COPY ktorcio ktorcio
 COPY ktorcio ktorcio
+COPY ktornetty ktornetty
 COPY netty netty
 COPY netty netty
 COPY undertow undertow
 COPY undertow undertow
 RUN gradle --quiet build undertow:shadowJar
 RUN gradle --quiet build undertow:shadowJar

+ 15 - 0
frameworks/Kotlin/http4k/ktornetty/build.gradle

@@ -0,0 +1,15 @@
+dependencies {
+    compile project(":core")
+    compile "org.http4k:http4k-server-ktornetty:$http4k_version"
+}
+
+apply plugin: 'application'
+mainClassName = "Http4kKtorNettyServerKt"
+apply plugin: 'com.github.johnrengelman.shadow'
+
+shadowJar {
+    baseName = "http4k-$project.name-benchmark"
+    classifier = null
+    version = null
+    mergeServiceFiles()
+}

+ 5 - 0
frameworks/Kotlin/http4k/ktornetty/src/main/kotlin/Http4kKtorNettyServer.kt

@@ -0,0 +1,5 @@
+import org.http4k.server.KtorNetty
+
+fun main() {
+    Http4kBenchmarkServer(PostgresDatabase("tfb-database")).start(KtorNetty(9000))
+}

+ 1 - 0
frameworks/Kotlin/http4k/settings.gradle

@@ -3,5 +3,6 @@ include 'core'
 include 'apache'
 include 'apache'
 include 'jetty'
 include 'jetty'
 include 'ktorcio'
 include 'ktorcio'
+include 'ktornetty'
 include 'netty'
 include 'netty'
 include 'undertow'
 include 'undertow'