Windows CPU utilisation is low for 16 CPUs and high for 4 CPUs.

Anonymous
2024-05-22T06:21:39+00:00

I am having a windows 2019 server installed in my VM on vsphere. My main concern is regarding the performance of the program related to Spark that i run on the VM. It is utilising almost 90% CPUs on an average for a system with 4 CPUs. Let's assume it takes some x time for this. I want to increase the performance so that multi-threading can happen properly. For this , I increase the number of CPUs in the VM from 4 to 16. After this, when i am running the same program with same configurations, it is taking a lot more time almost 10x times. The CPU utilisation in this case also dropped to an average of 20-30%.

https://answers-afd.microsoft.com/static/images/image-not-found.jpg
Tried with 4,8,16 CPUs. The observed average CPU utilisation on different number of CPUs are :-

  • 4 CPUs = 90%
  • 8 CPUs = 40-45%
  • 16 CPUs = 20%

Also tried changing the default power plan of the Windows VM from "Balanced" to "High performance". Changed the priority of the service to high and affinity of the service to use all the cores. Also tried with some changes in the Power options but no luck as of now.

It would be very helpful if anyone would guide me in this issue to increase the CPU utilisation of the system for better performance.

Windows for business | Windows Server | Performance | System performance

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2024-05-22T06:43:39+00:00

    Hello,

    Thank you for posting in Microsoft Community forum.

    Based on the description, I understand your question is related to Windows CPU utilisation is low for 16 CPUs and high for 4 CPUs.

    1. Check in Services console, if the Spark service is set to auto start and high priority.
    2. After you switched to High performance power plan, ensure that there are no other power plan settings that might be limiting performance.
    3. If you’re using SQL Server, check if the Resource Governor is configured correctly and not limiting the resources for your Spark program.
    4. Ensure that the Spark program is set to use all available CPUs. You can set CPU affinity for a process in the Task Manager under the “Details” tab.
    5. Review the Spark application configuration to ensure it’s optimized for multi-threading and distributed computing.

    It is also recommended to seek help from Spark support team for further assistance.

    Have a nice day. 

    Best Regards,

    Molly

    0 comments No comments
  2. Anonymous
    2024-05-22T08:55:43+00:00

    Hi Molly,
    Thanks for your response. Based on the suggestions from your side. Following are my updates:-

    1. Spark is already set to high priority , i confirmed from the task manager itself.
    2. After switching to high performance, now such power plan setting is there. Here is the screenshot of the power options.
    3. I am not using SQL server, all the work is done on local machine only,
    4. I also checked the Spark jobs , it is detecting all the 16 CPUs but not able to use it efficiently.
    5. Affinity of the program is already set to use all the cores.
    6. I am running the same program on Linux also, all the configurations are working fine there utilising all the CPU cores.

    I need further help to tackle this issue. Any suggestion is highly appreciated.

    Thanks and regards,

    Saksham Singh

    0 comments No comments
  3. Anonymous
    2024-05-23T03:21:05+00:00

    Dear Saksham Singh2,

    good morning.

    I assume that when you installed VM you had it installed with 4 proc.

    Can you do that again this time with 7 proc?

    See that utilization effectively takes time off the required time to fullfill task(s).

    0 comments No comments
  4. Anonymous
    2024-05-23T11:19:49+00:00

    Hi Bjarne,

    Thanks for your response. Yes, the VM had 4 processors when it was installed and then i increased them. As per your suggestion, I tried with 7 processors, the utilisation increases , even touches to 80-90% but overall the utilisation was between 40-60%. In the case of 4 processors, the utilisation is above 90% for most of the time. The time taken by 7 processors is also more as compared to 4 processors. [Just FYI - The program is using multi-threading and the number of threads is equal to (number of processors)/4]. Also tried increasing the number of threads but the utilisation remains same.

    Any suggestion is highly appreciated.
    Thanks and regards,

    Saksham Singh

    0 comments No comments
  5. Anonymous
    2024-05-23T11:51:27+00:00

    Bummer. I hoped that installing the VM anew with a number of proc's would make a difference as to increasing them afterwards.

    Probably you already set Windows to prioritise to Background Services and I would change service priority back to normal or even below normal. Affinity to all is the right way to go unless you've réally good reason not to.

    You are edging with four proc's at 90 % but it is still good. Perhaps you should leave it at that and utilize the other proc's for other tasks, maybe extra VM's or so, as you are not gaining time with more.

    Perhaps Spark computes what it needs to do its job most efficient, and its result is four proc's. Enforcing more on it is as we have a saying in Dutch (I am from the Netherlands): "Elkaar voor de voeten lopen." Literally translated as: "To walk in front of eachothers feet." Meaning you can be with too many for one task.

    0 comments No comments