0

I have written a multi-threaded program that is running on Windows server 2012.
The program will create threads to take advantage of multiple CPUs and I can control the number of simultaneous threads it will create. Each thread will normally use 100% of a CPU for several minutes (it is a very CPU intensive calculation and no I/O is done). Over the life of the process it will create and destroy ~1000 threads.

Task Manager reports that the server has 10 cores and 20 logical processors. I have tried many settings for the number of simultaneous threads, but the CPU utilization as shown from task manager never goes above ~30%. When I look at each thread, none is using more than ~3% total CPU - when they should be using 100%.

Another point to note: if I run two of these processes at the same time each will use ~30% of the available CPU.

I have run the same program on my 4-core Windows 10 laptop and have no problem with it using all the CPU.

Can anyone see a reason why Windows Server 2012 would limit my process to ~30% of the total CPU available?

  • One thing I have tried is setting [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Quota System] "EnableCpuQuota"=dword:00000000 and rebooting. Did not make any difference. – shindigo Aug 7 '17 at 13:09
  • You need to provide more information. Interactive or scheduled task? Command prompt application or Windows application? Have you tried running it from the console session? – Greg Askew Aug 7 '17 at 14:58
  • It is a console app. I have tried both interactive and scheduled task. Ultimately it will run as a scheduled task. Not quite sure what you mean by "from the console session" - do you mean interactively from the command prompt? - if so, yes I have tried this. None of these variations have made a difference in CPU usage. – shindigo Aug 7 '17 at 15:13
  • 1
    mstsc /admin connects to a console session. – Greg Askew Aug 7 '17 at 15:20
  • Ah - sorry. I think I see what you are asking: am I running the program from a Remote Desktop session on the server? Yes, when I run it interactively my session is via Remote Desktop (I am using ASG RemoteDesktop). And I am an administrator. – shindigo Aug 7 '17 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.