Published 12月 16, 2013 by Kevin

Windows的CPU監控-使用效能監視器與WMI

研究Windows的CPU使用量-使用效能監視器與WMI

第一步就是確認CPU的使用率,如果有多CPU,還可以針對每一個CPU監控.如果要看所有CPU的平均使用率,則需要使用_Total那一個數值.
 Processor:% Processor Time
WMI 在:
Win32_PerfRawData_PerfOS_Memory  
Win32_PerfFormattedData_PerfOS_Memory
值為:
PercentProcessorTime
另外也可以監控Windows系統在CPU的使用率.
Processor: % Privileged Time
WMI值為:
PercentPrivilegedTime
使用者程式的CPU使用率.
Processor: %User Time
WMI值為:
PercentUserTime
還有監控等候CPU處理的程式數量,也對改善系統效能非常有幫助.
System: Processor Queue Length
這個的WMI在:
Win32_PerfRawData_PerfOS_System
Win32_PerfFormattedData_PerfOS_System
值為:
ProcessorQueueLength
在CPU監控上,也可以察覺一些系統硬體或軟體的問題,接著會分別列出來.
當CPU被中斷的太多時,可能就表示系統中的某個硬體太老舊或者出問題了,可以先更新可疑硬體的驅動程式試試看.
Processor : Interrupts /sec
Processor : % Interrupt Time
  • Interrupts /sec持續超過1000
  • Interrupt Time超過50%時必須注意
WMI跟之前的Processor在同樣的地方(Class),值為:
InterruptsPerSec
PercentInterruptTime    
另外還有一種中斷是被程式或者服務呼叫,這部分就可能是軟體方面的問題.
System : System Calls/sec
一樣的,WMI跟之前的System在同樣的地方(Class),值為:
SystemCallsPerSec
另外在針對個別軟體分析其CPU使用率時,則可以監控其個別的Process跟Thresd使用率.
Process : % Processor Time
Thread Object : % Processor Time
Process的WMI在:
Win32_PerfRawData_PerfProc_Process  
Win32_PerfFormattedData_PerfProc_Process
值為:
PercentProcessorTime
Thread的WMI在:
Win32_PerfRawData_PerfProc_Thread
Win32_PerfFormattedData_PerfProc_Thread
值為:
PercentProcessorTime
      edit