logoalt Hacker News

cyberpunklast Sunday at 4:37 PM3 repliesview on HN

You can get into difficulty with kubernetes here, as your jvm will detect all cores on the node but you may have set a resources limit on the pod/whatever, so it’ll assume it can spend more time doing stuff than it actually can, so often times it’s quite necessary to tune some things to prevent excessive switching etc.


Replies

EdwardDiegoyesterday at 1:59 AM

Nah they fixed the JVM to be container aware some versions ago - I do remember dealing with this in early Java 8 days, think Java 10 is when it got fixed, and then it was backported to later releases of Java 8.

dprattlast Sunday at 6:10 PM

Modern JVMs will detect orchestrator-set cgroup limits and size themselves accordingly. If you, for example, set a cpu limit for a pod to “1”, the JVM will size itself as if it was running on a single core machine.

vips7Llast Sunday at 9:57 PM

Afaik this was fixed a long time ago.