To limit, or not to limit - this is the question that Java developers ask themselves when configuring CPU resources for their Kubernetes pods. Avoiding a strict pod CPU limit can be beneficial for latency-sensitive workloads, as it prevents pauses caused by CPU throttling. At the same time, running without a CPU limit removes an important signal the JVM uses to size its internal thread pools.
When there’s no CPU limit set, even modern Java versions will “see” all CPUs available on
the Kubernetes node. In these cases, it’s often beneficial to explicitly override the ActiveProcessorCount to prevent JVM
and your frameworks/libraries from using too many threads and increase performance predictability.