Cloud Native 11 min read

Which JDK Performs Best on Kubernetes? A Detailed Comparison

This article benchmarks several popular JDK distributions on Kubernetes using a Spring Boot 3 application, measuring image size, startup time, memory consumption, and throughput with k6, and concludes that performance differences are minimal after repeated testing.

dbaplus Community
dbaplus Community
dbaplus Community
Which JDK Performs Best on Kubernetes? A Detailed Comparison

Purpose and Scope

The author repeatedly benchmarks the most popular JDK implementations on Kubernetes to obtain reproducible results, focusing on a simple Spring Boot 3 application that uses Spring Data MongoDB.

JDKs Tested

Adoptium Eclipse Temurin

Alibaba Dragonwell

Amazon Corretto

Azul Zulu

BellSoft Liberica

IBM Semeru OpenJ9

Oracle JDK

Microsoft OpenJDK

Test Environment

Machine: MacBook Pro, 32 GB RAM, Intel CPU

OS: macOS Ventura 13.1

Kubernetes (Docker Desktop) v1.25.2 – 14 GB RAM, 4 vCPU

Java version: 17

Load‑testing tool:

k6

Application Details

The app is a Spring Boot service that talks to a MongoDB instance running in the same Kubernetes cluster. For each JDK the previous deployment and database are deleted, then a fresh deployment is applied.

Measured Parameters

Application startup time (read from Spring Boot logs)

Throughput with 5 and 10 virtual users (requests per second)

Docker image size

Pod memory consumption (via kubectl top pod)

Deployment YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample-spring-boot-on-kubernetes-deployment
spec:
  selector:
    matchLabels:
      app: sample-spring-boot-on-kubernetes
  template:
    metadata:
      labels:
        app: sample-spring-boot-on-kubernetes
    spec:
      containers:
      - name: sample-spring-boot-on-kubernetes
        image: piomin/sample-spring-boot-on-kubernetes
        ports:
        - containerPort: 8080
        env:
        - name: MONGO_DATABASE
          valueFrom:
            configMapKeyRef:
              name: mongodb
              key: database-name
        - name: MONGO_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb
              key: database-user
        - name: MONGO_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mongodb
              key: database-password
        - name: MONGO_URL
          value: mongodb
        readinessProbe:
          httpGet:
            port: 8080
            path: /readiness
            scheme: HTTP
          timeoutSeconds: 1
          periodSeconds: 10
          successThreshold: 1
          failureThreshold: 3
        resources:
          limits:
            memory: 1024Mi

Image Size Results

Azul Zulu: 271 MB

IBM Semeru OpenJ9: 275 MB

Eclipse Temurin: 286 MB

BellSoft Liberica: 286 MB

Oracle OpenJDK: 446 MB

Alibaba Dragonwell: 459 MB

Microsoft OpenJDK: 461 MB

Amazon Corretto: 463 MB

Startup Time

Multiple restarts were performed for each JDK. The fastest average startup time was 7.20 s (Eclipse Temurin) and the slowest 9.05 s (IBM Semeru OpenJ9). The top three fastest averages were Eclipse Temurin (5.6 s), Amazon Corretto (5.95 s) and BellSoft Liberica (6.05 s).

Memory Consumption

During a 10‑user load test, most JDKs used 210–230 MB of RAM. IBM Semeru OpenJ9 used significantly more (≈135 MB), while others stayed within the mentioned range.

IBM Semeru OpenJ9: 135 MB

Oracle OpenJDK: 211 MB

Azul Zulu: 215 MB

Alibaba Dragonwell: 216 MB

BellSoft Liberica: 219 MB

Microsoft OpenJDK: 219 MB

Amazon Corretto: 220 MB

Eclipse Temurin: 230 MB

Throughput Testing with k6

The following k6 script posts JSON payloads to /persons and checks the response.

import http from 'k6/http';
import { check } from 'k6';

export default function () {
  const payload = JSON.stringify({
    firstName: 'aaa',
    lastName: 'bbb',
    age: 50,
    gender: 'MALE'
  });
  const params = { headers: { 'Content-Type': 'application/json' } };
  const res = http.post('http://localhost:8080/persons', payload, params);
  check(res, {
    'is status 200': (r) => r.status === 200,
    'body size is > 0': (r) => r.body.length > 0,
  });
}

Commands used:

$ k6 run -d 90s -u 5 load-tests.js
$ k6 run -d 90s -u 10 load-tests.js

Sample results (requests per second):

5 VU – BellSoft Liberica: 451 req/s, Amazon Corretto: 433 req/s, IBM Semeru OpenJ9: 432 req/s, …

10 VU – Eclipse Temurin: 580 req/s, Azul Zulu: 567 req/s, Microsoft OpenJDK: 561 req/s, …

Conclusion

After multiple repetitions of the load tests, the author finds no significant performance differences among the JDK vendors; results tend to converge as more tests are run.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaperformanceDockerKubernetesSpring BootJDK
dbaplus Community
Written by

dbaplus Community

Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.