Skip to content

Commit d2c8757

Browse files
rurorujj
andauthored
Fix some of the broken java base images (#10262)
* fix broken java base images * Update Hikari CP settings in httpserver and ring-http-exchange * Add semeru to ring-http-exchange --------- Co-authored-by: jj <[email protected]>
1 parent 4629cb3 commit d2c8757

File tree

11 files changed

+66
-24
lines changed

11 files changed

+66
-24
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,26 @@
8181
"display_name": "ring-http-exchange-robaho-graalvm",
8282
"notes": "",
8383
"versus": "ring-http-exchange-robaho"
84+
},
85+
"robaho-semeru": {
86+
"json_url": "/json",
87+
"plaintext_url": "/plaintext",
88+
"fortune_url": "/fortunes",
89+
"port": 8080,
90+
"approach": "Realistic",
91+
"classification": "Platform",
92+
"database": "postgres",
93+
"framework": "None",
94+
"language": "Clojure",
95+
"flavor": "None",
96+
"orm": "Raw",
97+
"platform": "None",
98+
"webserver": "None",
99+
"os": "Linux",
100+
"database_os": "Linux",
101+
"display_name": "ring-http-exchange-robaho-semeru",
102+
"notes": "",
103+
"versus": "ring-http-exchange-robaho"
84104
}
85105
}
86106
]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM clojure:lein as lein
2+
WORKDIR /ring-http-exchange
3+
COPY project.clj project.clj
4+
COPY resources resources
5+
COPY src src
6+
RUN lein with-profile robaho uberjar
7+
8+
FROM ibm-semeru-runtimes:open-25-jre-jammy
9+
WORKDIR /ring-http-exchange
10+
COPY --from=lein /ring-http-exchange/target/ring-http-server-1.0.0-standalone.jar app.jar
11+
12+
EXPOSE 8080
13+
14+
CMD ["java", "-server", "-XX:+UseParallelGC", "-jar", "app.jar"]

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
(def query-fortunes (boa/execute (boa/->NextJdbcAdapter) "fortune.sql"))
1616

1717
(def db-spec {:auto-commit true
18-
:read-only false
19-
:connection-timeout 30000
18+
:read-only true
19+
:connection-timeout 10000
2020
:validation-timeout 5000
2121
:idle-timeout 600000
2222
:max-lifetime 1800000
23-
:minimum-idle 10
24-
:maximum-pool-size 520
25-
:minimum-pool-size 512
23+
:minimum-idle 16
24+
:maximum-pool-size 64
2625
:register-mbeans false
2726
:jdbcUrl "jdbc:postgresql://tfb-database/hello_world?user=benchmarkdbuser&password=benchmarkdbpass"})
2827

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM maven:3.6.1-jdk-11-slim as maven
2-
1+
FROM maven:3.9.0-eclipse-temurin-17 as maven
32
WORKDIR /activej
43
COPY pom.xml pom.xml
54
COPY src src
65
RUN mvn compile assembly:single -q
76

8-
FROM openjdk:11.0.3-jdk-slim
7+
FROM amazoncorretto:25
98
WORKDIR /activej
109
COPY --from=maven /activej/target/activej-server-benchmark-0.0.1-SNAPSHOT-jar-with-dependencies.jar app.jar
11-
CMD ["java", "-Xms2G", "-Xmx2G", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-DHttpServerConnection.initialWriteBufferSize=4096", "-DHttpHeadersMultimap.initialSize=16", "-jar", "app.jar"]
10+
EXPOSE 8080
11+
CMD ["java", "-server", "-XX:+UseParallelGC", "-jar", "app.jar"]

frameworks/Java/dropwizard/dropwizard-jdbi-postgres.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn package -q -P postgres,jdbi
66

7-
FROM openjdk:11.0.3-jdk-slim
7+
FROM amazoncorretto:25
88
WORKDIR /dropwizard
99
COPY --from=maven /dropwizard/target/hello-world-0.0.1-SNAPSHOT.jar app.jar
1010
COPY hello-world-jdbi-postgres.yml hello-world-jdbi-postgres.yml

frameworks/Java/dropwizard/dropwizard-mongodb.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn package -q -P mongo
66

7-
FROM openjdk:11.0.3-jdk-slim
7+
FROM amazoncorretto:25
88
WORKDIR /dropwizard
99
COPY --from=maven /dropwizard/target/hello-world-0.0.1-SNAPSHOT.jar app.jar
1010
COPY hello-world-mongo.yml hello-world-mongo.yml

frameworks/Java/dropwizard/dropwizard-postgres.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn package -q -P postgres
66

7-
FROM openjdk:11.0.3-jdk-slim
7+
FROM amazoncorretto:25
88
WORKDIR /dropwizard
99
COPY --from=maven /dropwizard/target/hello-world-0.0.1-SNAPSHOT.jar app.jar
1010
COPY hello-world-postgres.yml hello-world-postgres.yml

frameworks/Java/dropwizard/dropwizard.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn package -q -P mysql
66

7-
FROM openjdk:11.0.3-jdk-slim
7+
FROM amazoncorretto:25
88
WORKDIR /dropwizard
99
COPY --from=maven /dropwizard/target/hello-world-0.0.1-SNAPSHOT.jar app.jar
1010
COPY hello-world-mysql.yml hello-world-mysql.yml

frameworks/Java/httpserver/pom.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,21 @@
3030
<artifactId>postgresql</artifactId>
3131
<version>42.7.2</version>
3232
</dependency>
33-
<dependency>
34-
<groupId>com.zaxxer</groupId>
35-
<artifactId>HikariCP</artifactId>
36-
<version>3.3.1</version>
37-
</dependency>
38-
3933
<dependency>
4034
<groupId>com.github.httl</groupId>
4135
<artifactId>httl</artifactId>
4236
<version>1.0.11</version>
4337
</dependency>
44-
4538
<dependency>
4639
<groupId>org.slf4j</groupId>
4740
<artifactId>slf4j-simple</artifactId>
4841
<version>1.8.0-beta4</version>
4942
</dependency>
43+
<dependency>
44+
<groupId>com.zaxxer</groupId>
45+
<artifactId>HikariCP</artifactId>
46+
<version>7.0.2</version>
47+
</dependency>
5048
</dependencies>
5149
<profiles>
5250
<profile>

frameworks/Java/httpserver/src/main/java/benchmarks/Server.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,23 @@ private static List<Fortune> queryFortunes(DataSource ds) throws SQLException {
5252
}
5353

5454
private static DataSource createPostgresDataSource() throws ClassNotFoundException {
55-
Class.forName("org.postgresql.Driver");
5655
HikariConfig config = new HikariConfig();
56+
5757
config.setJdbcUrl("jdbc:postgresql://tfb-database:5432/hello_world");
5858
config.setUsername("benchmarkdbuser");
5959
config.setPassword("benchmarkdbpass");
60-
config.setMaximumPoolSize(512);
60+
61+
config.setMaximumPoolSize(64);
62+
config.setMinimumIdle(16);
63+
64+
config.setConnectionTimeout(10000);
65+
config.setIdleTimeout(600000);
66+
config.setMaxLifetime(1800000);
67+
68+
config.setAutoCommit(true);
69+
70+
config.setPoolName("PostgreSQL-HikariCP-Pool");
71+
6172
return new HikariDataSource(config);
6273
}
6374

@@ -145,4 +156,4 @@ static void main(String[] args) throws Exception {
145156
// start server
146157
server.start();
147158
}
148-
}
159+
}

0 commit comments

Comments
 (0)