Monk CIMonk CI home

22 Nov, 2026Aishwarya Palta

Benchmark a Kafka Java Build on Monk CI


Run a reproducible Kafka Java build benchmark on Monk CI. Fix the source version, JDK and Gradle options, then compare cold and warm dependency builds.

A Kafka Java build benchmark gives you a substantial JVM workload for evaluating CI runners. This procedure builds Kafka’s JARs from source; it measures build execution, not broker throughput, and reports no measured speedup.

Our developer goal: make the workload reproducible before comparing machines. Use the same source, JDK and build options on each runner.

Which version should you build?

Use Kafka 3.9.0 as a fixed comparison fixture, not a recommendation for a new deployment. Its upstream README lists Java 17 among supported build environments and documents ./gradlew jar.

Install the same JDK 17 distribution and patch release on both runners. Kafka’s committed wrapper selects Gradle 8.8, so use ./gradlew instead of a system Gradle installation. Wrapper configuration.

After connecting Monk CI, select runs-on: monkci-ubuntu-24.04-4 for this starting configuration. Confirm available capacity with the runner-size guide.

What command should you measure?

Run these commands in a fresh Linux workspace with Git, JDK 17 and /usr/bin/time available:

set -eu
git clone --branch 3.9.0 --depth 1 https://github.com/apache/kafka.git
cd kafka
git checkout --detach 84caaa6e9da06435411510a81fa321d4f99c351f
git rev-parse HEAD
java -version
export GRADLE_USER_HOME="$PWD/.gradle-benchmark"
/usr/bin/time -p ./gradlew clean jar \
  --no-daemon --no-build-cache --max-workers=4

Record the resolved commit and reuse it for every comparison. Save the complete output, exit status and wall time. This command builds JARs; test-suite execution is a separate workload.

The Gradle options disable reusable task-output caching and set a consistent worker limit. clean removes project build outputs; it does not clear downloaded dependencies.

How do you compare cold and warm runs?

An initially empty benchmark Gradle home includes wrapper and dependency downloads. Repeating the command with that home retained measures a build with warmed downloads while rebuilding project outputs.

Label those cases separately. Repeat each configuration, keep failures and report the median plus observed range. Record CPU, memory, JDK patch version and network conditions alongside timings.

Compare elapsed time with the applicable runner cost. A faster build is useful evidence only when the workload and cache conditions are comparable.

Try Monk CI for free

Continue with GitHub