| ▲ | brunoborges 3 hours ago | ||||||||||||||||||||||
Lots of details that teams miss when tuning the JVM on Kubernetes: 1. Default heap size varies: it can be 50% of the available memory for any amount of available memory up to 256mb; ~128mb for anywhere between 256 and 512; and then 25% for anything above 512mb; 2. The JVM will still do parallel threads even when CPU limit is 1,000 or below , which triggers CPU throttling much faster. Threads such as GC (even when it is SerialGC), ForkJoin pools, Database connection pools, HTTP server, and so on. 3. The JVM behaves MUCH better with 2,000 or more milicores, and a well sized heap. Having very small containers and dozens of replicas is worse than having slightly bigger containers (cpu/memory limits) and fewer replicas, even with a different ratio (e.g. 6 replicas will perform worse than 3 replicas, even when aggregated CPU and memory limits are the same). I've been advocating on this for years [1]. | |||||||||||||||||||||||
| ▲ | joosd 4 minutes ago | parent | next [-] | ||||||||||||||||||||||
Hey man just wanted to let you know years ago our team used your Devoxx talk as a starting point for tuning our Java apps that are running on K8s and it has been of tremendous help. I still refer back to it every now and then! | |||||||||||||||||||||||
| ▲ | gavinray an hour ago | parent | prev [-] | ||||||||||||||||||||||
Modern JVM's (JDK +10) have runtime detection for whether they're operating in a container environment, and apply sensible defaults based dynamically on resources if so. Google term: "-XX:+UseContainerSupport" | |||||||||||||||||||||||
| |||||||||||||||||||||||