JVM only using half the cores on a server
Asked Answered
I

0

7

I have a number of Java processes using OpenJDK 11 running on Windows Server 2019. The server has two physical processors and 36 total cores; it is an HP machine. When I start my processes, I see work allocation in Task Manager across all the cores. This is good. However after the processes run for some period of time, not a consistent amount of time, the machine begins to only utilize only half the cores.

I am working off a few theories:

  1. The JDK has some problem that is preventing it from consistently accessing all the cores.

  2. Something with Windows Server 2019 is causing a problem, limiting Java from accessing all the cores.

  3. There is a thermal management problem and one processor is getting too hot and the OS is directing all the processing to the other processor.

  4. There is some issue with hyper-threading and the 'logical' processors that is causing the process to not be able to utilize all the cores.

I've tried searching for JDK issues and haven't found anything like this mentioned. I went down to the server and while it's running a little warm, it didn't appear excessively hot. I have not yet tried disabling hyper-threading. I have tried a number of parameters to force the JVM to use all the cores and indeed the process initially does use all the cores; I can see the activity in Task Manager.

Anyone have any thoughts? This is a really baffling problem and I'd appreciate any ideas.

UPDATE: I am able to make it use the other processor by using the Task Manager to assign one of the java.exe processes to the other processor. This is also working from the java invocation on the command line as well with an argument for which socket to use.

Now that said, this feels like a hack. I don't see why I should have to manually assign a socket to each of my java processes; that job should be left to the OS. I'm still not sure exactly where the problem is, if it's the OS or what.

Ignition answered 16/1, 2020 at 20:28 Comment(4)
Is that a NUMA architecture? Sometimes the operating system then tries to keep all threads/processes on one physical CPU (I know that database server very often suffer from that)Forehead
I am not sure, is there a way I can tell if the server has NUMA or not?Ignition
How do I know if my server has NUMAIncursive
@Incursive Unfortunately I am on Windows 2019 and your link pertains to Linux. I can see sockets, cores, and logical processors. I'm not really sure how to determine the NUMA settings on a Windows machine. Any thoughts?Ignition

© 2022 - 2024 — McMap. All rights reserved.