From 0abcc76f20276485e8e07dbc62ca9e119c5f1eff Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 22 Apr 2025 11:38:27 +0200 Subject: [PATCH 1/3] Use a reasonnable pipelining limit value --- frameworks/Java/vertx/src/main/java/vertx/App.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/Java/vertx/src/main/java/vertx/App.java b/frameworks/Java/vertx/src/main/java/vertx/App.java index ca9d0929cca..9cadce1efbb 100755 --- a/frameworks/Java/vertx/src/main/java/vertx/App.java +++ b/frameworks/Java/vertx/src/main/java/vertx/App.java @@ -171,7 +171,7 @@ public void start(Promise startPromise) throws Exception { options.setPassword(config.getString("password", "benchmarkdbpass")); options.setCachePreparedStatements(true); options.setPreparedStatementCacheMaxSize(1024); - options.setPipeliningLimit(100_000); // Large pipelining means less flushing and we use a single connection anyway + options.setPipeliningLimit(256); // Large pipelining means less flushing and we use a single connection anyway Future clientsInit = initClients(options); clientsInit .transform(ar -> { From 0a1360e5b7804f634d3b834d64a0690fcc82d68d Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 22 Apr 2025 11:36:37 +0200 Subject: [PATCH 2/3] Bump Vert.x to OpenJDK 24 --- frameworks/Java/vertx/vertx-postgres.dockerfile | 8 ++++++-- frameworks/Java/vertx/vertx.dockerfile | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frameworks/Java/vertx/vertx-postgres.dockerfile b/frameworks/Java/vertx/vertx-postgres.dockerfile index 95e731f2d9a..afcb00f4866 100644 --- a/frameworks/Java/vertx/vertx-postgres.dockerfile +++ b/frameworks/Java/vertx/vertx-postgres.dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.9.0-eclipse-temurin-17 as maven +FROM maven:3.9.9-eclipse-temurin-24-noble as maven WORKDIR /vertx COPY src src COPY pom.xml pom.xml @@ -9,6 +9,9 @@ EXPOSE 8080 CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \ sed -i "s|tfb-database|$DBIP|g" /vertx/src/main/conf/config.json && \ java \ + --enable-native-access=ALL-UNNAMED \ + --sun-misc-unsafe-memory-access=allow \ + --add-opens=java.base/java.lang=ALL-UNNAMED \ -Xms2G \ -Xmx2G \ -server \ @@ -22,7 +25,8 @@ CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \ -Dvertx.cacheImmutableHttpResponseHeaders=true \ -Dvertx.internCommonHttpRequestHeadersToLowerCase=true \ -Dvertx.eventLoopPoolSize=$((`grep --count ^processor /proc/cpuinfo`)) \ - -Dio.netty.buffer.checkBounds=false \ + -Dio.netty.noUnsafe=false \ + -Dio.netty.buffer.checkBounds=false \ -Dio.netty.buffer.checkAccessible=false \ -jar \ target/vertx.benchmark-0.0.1-SNAPSHOT-fat.jar \ diff --git a/frameworks/Java/vertx/vertx.dockerfile b/frameworks/Java/vertx/vertx.dockerfile index 27c34140e64..e78d0ff9038 100644 --- a/frameworks/Java/vertx/vertx.dockerfile +++ b/frameworks/Java/vertx/vertx.dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.9.0-eclipse-temurin-17 as maven +FROM maven:3.9.9-eclipse-temurin-24-noble as maven WORKDIR /vertx COPY src src COPY pom.xml pom.xml @@ -6,4 +6,4 @@ RUN mvn package -q EXPOSE 8080 -CMD ["java", "-Xms2G", "-Xmx2G", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-Djava.lang.Integer.IntegerCache.high=10000", "-Dvertx.disableMetrics=true", "-Dvertx.disableWebsockets=true", "-Dvertx.disableContextTimings=true", "-Dvertx.disableHttpHeadersValidation=true", "-Dvertx.cacheImmutableHttpResponseHeaders=true", "-Dvertx.internCommonHttpRequestHeadersToLowerCase=true", "-Dio.netty.buffer.checkBounds=false", "-Dio.netty.buffer.checkAccessible=false", "-jar", "target/vertx.benchmark-0.0.1-SNAPSHOT-fat.jar", "src/main/conf/config.json"] +CMD ["java", "--enable-native-access=ALL-UNNAMED", "--sun-misc-unsafe-memory-access=allow", "--add-opens=java.base/java.lang=ALL-UNNAMED", "-Xms2G", "-Xmx2G", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-Djava.lang.Integer.IntegerCache.high=10000", "-Dvertx.disableMetrics=true", "-Dvertx.disableWebsockets=true", "-Dvertx.disableContextTimings=true", "-Dvertx.disableHttpHeadersValidation=true", "-Dvertx.cacheImmutableHttpResponseHeaders=true", "-Dvertx.internCommonHttpRequestHeadersToLowerCase=true", "-Dio.netty.noUnsafe=false", "-Dio.netty.buffer.checkBounds=false", "-Dio.netty.buffer.checkAccessible=false", "-jar", "target/vertx.benchmark-0.0.1-SNAPSHOT-fat.jar", "src/main/conf/config.json"] From 93f7991c3c28e738291c4aad9634e5b79c714543 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 22 Apr 2025 11:41:51 +0200 Subject: [PATCH 3/3] Update vertx transport section to use io_uring on Linux --- frameworks/Java/vertx/pom.xml | 104 +++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/frameworks/Java/vertx/pom.xml b/frameworks/Java/vertx/pom.xml index a827456676c..15bac6dd2a4 100644 --- a/frameworks/Java/vertx/pom.xml +++ b/frameworks/Java/vertx/pom.xml @@ -41,18 +41,6 @@ jsonsergen 0.0.5 - - io.netty - netty-transport-native-kqueue - ${netty.version} - osx-x86_64 - - - io.netty - netty-transport-native-epoll - ${netty.version} - linux-x86_64 - com.github.ben-manes.caffeine caffeine @@ -149,9 +137,30 @@ - Linux + linux-x86_64 + + + linux + x86_64 + + + + + io.netty + netty-transport-native-io_uring + ${netty.version} + linux-x86_64 + + + + + + linux-amd64 - false + + linux + amd64 + @@ -162,6 +171,73 @@ + + + linux-aarch64 + + + linux + aarch64 + + + + + io.netty + netty-transport-native-io_uring + ${netty.version} + linux-aarch_64 + + + + + + osx-x86_64 + + + mac + x86_64 + + + + + io.netty + netty-resolver-dns-native-macos + ${netty.version} + osx-x86_64 + + + io.netty + netty-transport-native-kqueue + ${netty.version} + osx-x86_64 + + + + + + osx-aarch64 + + + mac + aarch64 + + + + + io.netty + netty-resolver-dns-native-macos + ${netty.version} + osx-aarch_64 + + + io.netty + netty-transport-native-kqueue + ${netty.version} + osx-aarch_64 + + + +