Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit 50de0f6

Browse files
rurorujj
andauthored
Minor improvements in ring-http-exchange and robaho (#10605)
* Update Robaho httpserver config * Remove postgress images Verify fortunes along with other tests * Move zgc test from ring-http-exchange to httpserver update depeendencies for ring-http-exchange --------- Co-authored-by: jj <keistaslogairkosulys@gmail.com>
1 parent b9e175b commit 50de0f6

18 files changed

Lines changed: 52 additions & 150 deletions

frameworks/Clojure/ring-http-exchange/benchmark_config.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,7 @@
4242
"notes": "",
4343
"versus": "httpserver-robaho"
4444
},
45-
"robaho-zgc": {
46-
"json_url": "/json",
47-
"plaintext_url": "/plaintext",
48-
"fortune_url": "/fortunes",
49-
"port": 8080,
50-
"approach": "Realistic",
51-
"classification": "Platform",
52-
"database": "postgres",
53-
"framework": "None",
54-
"language": "Clojure",
55-
"flavor": "None",
56-
"orm": "Raw",
57-
"platform": "Ring",
58-
"webserver": "None",
59-
"os": "Linux",
60-
"database_os": "Linux",
61-
"display_name": "ring-http-exchange-robaho-zgc",
62-
"notes": "",
63-
"versus": "ring-http-exchange-robaho"
64-
},
6545
"robaho-is": {
66-
"json_url": "/json",
67-
"plaintext_url": "/plaintext",
6846
"fortune_url": "/fortunes",
6947
"port": 8080,
7048
"approach": "Realistic",

frameworks/Clojure/ring-http-exchange/config.toml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,6 @@ platform = "httpserver"
5757
webserver = "None"
5858
versus = "httpserver-robaho-graalvm"
5959

60-
[robaho-zgc]
61-
urls.plaintext = "/plaintext"
62-
urls.json = "/json"
63-
urls.fortune = "/fortunes"
64-
approach = "Realistic"
65-
classification = "Platform"
66-
database = "postgres"
67-
database_os = "Linux"
68-
os = "Linux"
69-
orm = "Raw"
70-
platform = "httpserver"
71-
webserver = "None"
72-
versus = "ring-http-exchange-robaho"
73-
7460
[robaho-is]
7561
urls.plaintext = "/plaintext"
7662
urls.json = "/json"

frameworks/Clojure/ring-http-exchange/project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
:dependencies [[org.clojure/clojure "1.12.3"]
88
[org.clojure/tools.logging "1.3.0"]
9-
[org.clojars.jj/ring-http-exchange "1.2.14"]
9+
[org.clojars.jj/ring-http-exchange "1.2.16"]
1010
[seancorfield/next.jdbc "1.2.659"]
11-
[org.clojars.jj/majavat "1.15.1"]
11+
[org.clojars.jj/majavat "1.18.0"]
1212
[hikari-cp "3.3.0"]
13-
[org.clojars.jj/boa-sql "1.0.0"]
13+
[org.clojars.jj/boa-sql "1.0.1"]
1414
[org.postgresql/postgresql "42.7.8"]
1515
[metosin/jsonista "0.3.13"]
1616
]

frameworks/Clojure/ring-http-exchange/ring-http-exchange-robaho-graalvm.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY --from=lein /ring-http-exchange/target/ring-http-server-1.0.0-standalone.ja
1111

1212
EXPOSE 8080
1313

14-
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-jar", "app.jar"]
14+
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-Drobaho.net.httpserver.nodelay=true", "-jar", "app.jar"]

frameworks/Clojure/ring-http-exchange/ring-http-exchange-robaho-is.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY --from=lein /ring-http-exchange/target/ring-http-server-1.0.0-standalone.ja
1111

1212
EXPOSE 8080
1313

14-
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-jar", "app.jar", "--inputstream"]
14+
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-Drobaho.net.httpserver.nodelay=true", "-jar", "app.jar", "--inputstream"]

frameworks/Clojure/ring-http-exchange/ring-http-exchange-robaho-semeru.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY --from=lein /ring-http-exchange/target/ring-http-server-1.0.0-standalone.ja
1111

1212
EXPOSE 8080
1313

14-
CMD ["java", "-Xtune:throughput", "-Xgcpolicy:optthruput", "-XX:MaxRAMPercentage=70", "-XX:+UseContainerSupport", "-Dclojure.compiler.direct-linking=true", "-jar", "app.jar"]
14+
CMD ["java", "-Xtune:throughput", "-Xgcpolicy:optthruput", "-XX:MaxRAMPercentage=70", "-XX:+UseContainerSupport", "-Dclojure.compiler.direct-linking=true", "-Drobaho.net.httpserver.nodelay=true", "-jar", "app.jar"]

frameworks/Clojure/ring-http-exchange/ring-http-exchange-robaho-zgc.dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

frameworks/Clojure/ring-http-exchange/ring-http-exchange-robaho.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY --from=lein /ring-http-exchange/target/ring-http-server-1.0.0-standalone.ja
1111

1212
EXPOSE 8080
1313

14-
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-jar", "app.jar"]
14+
CMD ["java", "-server", "-XX:+UseParallelGC", "-XX:MaxRAMPercentage=70", "-Dclojure.compiler.direct-linking=true", "-Drobaho.net.httpserver.nodelay=true", "-jar", "app.jar"]

frameworks/Clojure/ring-http-exchange/src/ring_http_exchange/benchmark.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
(def db-spec {:idle-timeout 15000
1313
:max-lifetime 60000
1414
:minimum-idle 0
15-
:maximum-pool-size 128
16-
:jdbcUrl "jdbc:postgresql://tfb-database/hello_world?user=benchmarkdbuser&password=benchmarkdbpass"})
15+
:maximum-pool-size 1024
16+
:jdbcUrl "jdbc:postgresql://tfb-database/hello_world?user=benchmarkdbuser&password=benchmarkdbpass&tlsnowait=true"})
1717

1818
(defn -main
1919
[& args]

frameworks/Clojure/ring-http-exchange/src/ring_http_exchange/input_stream_handler.clj

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22
(:require
33
[jj.majavat :as majavat]
44
[jj.majavat.renderer :refer [->InputStreamRenderer]]
5-
[jj.majavat.renderer.sanitizer :refer [->Html]]
6-
[jj.sql.boa :as boa]
7-
[jsonista.core :as json])
5+
[jj.sql.boa :as boa])
86
(:import (java.io ByteArrayInputStream)))
97

108
(defrecord Response [body status headers])
119

12-
(def query-fortunes (boa/execute (boa/->NextJdbcAdapter) "fortune.sql"))
10+
(def query-fortunes (boa/build-query (boa/->NextJdbcAdapter) "fortune.sql"))
1311

14-
(def ^:private hello-world "Hello, World!")
1512
(def ^:private hello-world-bytes (.getBytes "Hello, World!"))
1613
(def ^:private ^:const additional-message {:id 0
1714
:message "Additional fortune added at request time."})
1815
(def ^:private ^:const fortune-headers {"Server" "ring-http-exchange"
1916
"Content-Type" "text/html; charset=UTF-8"})
20-
(def ^:private ^:const json-headers {"Server" "ring-http-exchange"
21-
"Content-Type" "application/json"})
22-
(def ^:private ^:const plain-text-headers {"Server" "ring-http-exchange"
23-
"Content-Type" "text/plain"})
2417

25-
(def ^:private render-fortune (majavat/build-renderer "fortune.html"
26-
{:renderer (->InputStreamRenderer
27-
{:sanitizer (->Html)})}))
18+
19+
(def ^:private render-fortune (majavat/build-html-renderer "fortune.html"
20+
{:renderer (->InputStreamRenderer)}))
2821

2922
(defn- get-body [datasource]
3023
(let [context (as-> (query-fortunes datasource) fortunes
@@ -35,8 +28,6 @@
3528
(defn get-handler [data-source]
3629
(fn [req]
3730
(case (req :uri)
38-
"/plaintext" (Response. (ByteArrayInputStream. hello-world-bytes) 200 plain-text-headers)
39-
"/json" (Response. (ByteArrayInputStream. (json/write-value-as-bytes {:message hello-world})) 200 json-headers)
4031
"/fortunes" (Response. (get-body data-source) 200 fortune-headers)
4132
(Response. (ByteArrayInputStream. hello-world-bytes) 200 {"Server" "ring-http-exchange"
4233
"Content-Type" "text/plain"}))))

0 commit comments

Comments
 (0)