Effect of setting CPU quota on Java performance
thomas.schatzl at oracle.com
Mon Feb 5 12:44:15 UTC 2018
On Mon, 2018-02-05 at 11:18 +0530, Ashutosh Mehra1 wrote:
> I have been trying to understand if setting CPU quota limit on a
> docker container, provided the "effective" CPUs are the same, has any
> impact on the application performance.
> As an example, if my app is running on 4 CPUs @ 100% quota, would I
> get same performance if my app is running on 8 CPUs at 50% quota? Note
> that "effective" CPUs is 4 in both cases.
I can imagine that using "half-cpus" has significant detrimental impact
on latency: i.e. it would as far as I understand provising partial cpus
increase the chance that during a safepoint threads will be scheduled
out, or threads moved between cpus.
The container heuristics for choosing the number of threads do try to
adapt for this (as your examples and results imply), but there likely
still is the overhead of the (additional) reschedules.
Of course this might be dependent a lot on OS/kernel etc.
More information about the jdk-dev