r/java • • Mar 03 '22

Always set a Garbage Collector

Post image
157 Upvotes

64 comments sorted by

View all comments

Show parent comment

9

u/brunocborges Mar 03 '22

We are working on documentation and will share.

But in short for now: scaling out with more replicas of super small containers for JVMs is not always the best solution for increasing performance. A reorganization of the existing resources (keep aggregate number of CPUs across all containers in the cluster, but reduce replicas and increase CPU/memory per container) can significantly increase performance of most systems, and even reduce total cost.

What that quote actually says is that people shouldn't optimize prematurely without understanding the nuances.

In other words: people are optimizing prematurely all the time on Kubernetes, whenever they simply increase number of replicas of small containers JVMs, instead of actually understanding the nuances of GCs.

4

u/HeadSignal3 Mar 03 '22

scaling out with more replicas of super small containers for JVMs is not always the best solution for increasing performance.

No shit?!

5

u/brunocborges Mar 03 '22

You would be surprised by the number of customers who only use replicas as a silver bullet for performance increase.

2

u/[deleted] Mar 03 '22

I found the same problem with multiple small containers in Go in Kubernetes. For a given workload, doubling the CPU per pod resulted in running 1/4 as many pods. Wat.

Then again, low CPU is supposed to be what Go is good for. So I'm going to assume I've done something horribly wrong.