Perfmon counters and thresholds for CPU utilization at OS Level:
CPU Utilization Counters at OS Level:
- \Processor\% Processor Time:
 - Sum of %user time and % provileged time.
 - If Processor is below 90% if normal, if is spikes above 90% then there is an issue.
 
- \Processor\% Privileged Time
 - Privileged Time is the amount of time being spent in the Windows kernel executing system calls such as drivers, IRPs (I/O Request Packets), context switching, etc.
 - If the operating system is spending more than 30% of it’s time in privileged mode, then it means that it is likely doing a high amount of I/O and one or more of the drivers are executing to manage that I/O.
 - If more than 30% involve Windows Admins.
 - Ref: heroix datascience mitel
 
- \Processor(*)\% Interrupt Time
 - Is the time the processor spends receiving and servicing hardware interrupts during sample intervals.
 
- \Processor(*)\% DPC Time
 - Deferred process call means OS is waiting to do something later on.
 - Issue if Both Interrupt time and dpc time High above 20%.
 - High Deferred Procedure Calls (DPCs) and high interrupts are typically caused by very busy or poorly written device drivers.
 - If “\Processor(*)\% DPC Time” is greater than 20%, or if “\Processor(*)\% Interrupt Time” is greater then 20%. Then check following:
 - Press caps lock key on keyboard and its respond in time.
 - If the Cap Lock key light does not respond, then the computer is hung due to a hardware problem. Otherwise, it is most likely a software problem.
 
- IF low than 20%: Then check following:
 - If “\Processor(*)\% DPC Time” is not greater than 20%, or if “\Processor(*)\% Interrupt Time” is not greater then 20%. If both of the counters above show very low values (less than 20%), then it could also be caused by high amounts of context switches per second.
 - Reference: Microsoft
 
- \System\Context Switches/sec:
 - When high priority enters low priority processes are switched then context switch happens).
 - Normal is considered 1000 or below 5000 if it exceed 15,000 per second per processor, then there is a constraint.
 - Reference: Mitel
 
- \System\Processor Queue Length
 - It should not greater than 2.
 
- \Processor(*)\% User Time(for user apps)
 - Processor: % User Time – percentage of time the processor spends on executing user processes such as SQL Server. This includes I/O requests from SQL Server.
 - Ref: datascience
 
- Process (sqlservr): % Privileged Time
 - The sum of processor time on each processor for all threads of the process (SQL Kernel)
 - Divide SQL Server %Privileged Time by number of logical processors to understand if the usage is due to SQL Kernal. If this value is more than 30% involve the Windows Admins. (Process (sqlservr): % Privileged Time / No of logical cpus)
 - Potential causes could be antivirus faulty drivers or encryption services.
 
CPU Utilization Parameters at SQL Level:
- Check the following configurations are according to Microsoft Best Practice recommendations:
 - Affinity Mask
 - Cost Threshold for Parallelism
 - Max Degree of Parallelism
 - Ref: Microsoft
 - Max Worker Threads
 - Optimize for ad-hoc workloads
 - Priority boost