Quarkus (Java) vs Fiber (Go): Performance Benchmark in Kubernetes #201

preview_player
Показать описание


▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (12+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)

▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬

▬▬▬▬▬▬▬ Timestamps ⏰ ▬▬▬▬▬▬▬
0:00 Intro
0:48 Java Quarkus Overview
1:38 Golang Overview
1:59 What is a Percentile?
3:42 1st Test Diagram
4:53 2nd Test Diagram
5:59 Image Size
9:35 Startup time
11:23 1st Test
13:37 2nd Test

▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬

#java #golang #kubernetes
Рекомендации по теме
Комментарии
Автор

A benchmark must be like this. State of art. Good job!

PanicAtProduction
Автор

Wow, this is really good. The setup (kubernetes cluster, prometheus, grafana ...) deserves another video.

avalagum
Автор

Please do Java Spring Boot (Native) vs Spring Boot (JDK) VS Quarkus (Native) vs Quarkus (JDK)

renbangbprd
Автор

I am go fanboy but I really like applications written in Quarkus. My first language was Java and it is mind-blowing how fast and light Quarkus feels compared to Spring

ДеянДелчев-ыз
Автор

This second test scenario is absolute perfection in testing real world applications. It's easy to get excited about a performance difference of like 400% (for example) in a synthetic benchmark, but by including database, storage and (de)serializing, it gives a much more nuanced picture of how it would actually scale and perform. In this case I would say both applications performed well and comparable. I'd be interested in a bit of a deeper dive in these applications by including opentelemetry and seeing what functions might bottleneck.

TweakMDS
Автор

Finally! A detailed comparison that just doesn’t test the /hello-world endpoint

ninjaasmoke
Автор

Love these benchmark videos, nice work

SeySvK
Автор

Interesting comparison, BUT:
- the first tests does not test the startup time itself (should be <1s for both apps)
- you haven't mentioned whether your kubelet has disabled `serializedImagePulls` (for concurrent pulls). This makes sense mostly for multi-layered images, but still - the base would be could be downloaded separately
- if you cannot parallelize the downloads, you can pre-cache the images on every worker node with senthilrch/kube-fledged. Not sure how well will it work with Karpenter + spot instances or Fargate nodes
- aside of image pull, most of the time you wait for health checks to pass (and we know they're stubbed to return OK), so they make no sense.
- you've used an outdated Go AWS SDK - there is v2
- the Go code does not use prepared statements - I bet it impacts the SQL latency, because every query must create new statement (and calculate the execution plan too?). Additionally concatenating/formatting raw SQL is unsafe :)
- Java code always prepares the same SQL query for every request, which should (?) unnecessarily slow it down - unless PgPool implements some caching there?
- when building Go binary, you can use `ldflags -s -w` to reduce the image size. I've tried it and according to `docker image inspect` I see an improvement from 46M to 39M.
- Go is not aware of cgroups, thus limits put on a pod are not automatically detected by the runtime (Java is cgroup-aware since JDK 8u131). IMO you should use uber-go/automaxprocs so Go does not think it has more CPU than allowed, and set the GOMEMLIMIT to reference `limits.memory` or use KimMachineGun/automemlimit (I don't think it will impact the benchmark)
- not sure what you've tried to achieve in Java DeviceResource, but the `devices` field should've been simple `private final` one initialized with `Set.of()` in the constructor. No synchronization needed, since all you do is read.

Also: both GraalVM and Golang allow for use of PGO, would be nice to see the impact in case of such simple apps.

DillPL
Автор

This is definitely the best DevOps channel.

jorgetovar
Автор

please do c# vs Java, use minimal api with AOT for c# and GraalVM or whatever AOT thing Java has.

Bourn
Автор

Love these benchmark videos, your work is amazing!

GabrielPozo
Автор

Please test dotnet lastest 8 vs go thanks

xelesarc
Автор

бро ты красавчик, ничего лишнего, все по делу, качество и битрейт на высоте, видосик красивый, респект!

gasha
Автор

Seems like Java 21 was used but Virtual threads wasn't used for the Quarkus application. Wasn't that the whole point to using newer Java version with the performance improvements and non-blocking reactivity APIs?

henryong
Автор

From the whole video I have profited so much in percentails. You have clear so much

cewa
Автор

this is so professional!
I love it!
please do bun vs deno v2
since deno has gotten npm compatibility, the only difference now between bun and deno (aside from being written in zig and rust) is the speed (I think, both have gotten very nice std library)

please do a benchmark comparing everything!

Serizon_
Автор

Could you do the same test for Kotlin and Java ? Or Kotlin and Go. Please 🙏

shamilAliyev
Автор

Interestingly, in your Test scenario 2, your Quarkus app is spiking in DB latency while having constant times in between, as if the Postgres client would be idling to gather the queries (or waiting on a lock?) and send them in bursts.

Nick-ydrc
Автор

First of all, this is the best content on youtube so far.
Well done. Thank you!

mayboroda
Автор

There was a non-blocking Netty server implemented with Spring Reactive Web, which is more efficient.

for databae approach use R2DBC the reactive nonblocking data repository.
btw spring also support graalvm and it is not outdated.

phyohtetpaing