Microsoft Windows:如何使用 PowerShell 從叢集的所有節點收集 Perfmon

摘要: 本文說明如何使用 PowerShell 從叢集的所有節點收集效能記錄。

本文章適用於 本文章不適用於 本文無關於任何特定產品。 本文未識別所有產品版本。

說明

以系統管理員身分執行 powershell ,然後複製並貼上下列命令:

Get-ClusterNode).Name | % {Invoke-Command -ComputerName $_ -ScriptBlock {"$(logman create counter FULL-Short -o "c:\diag\%computername%_PerfLog-Short.blg" -f bincirc -v mmddhhmm -max 500 -c "\Cache\*" "\Cluster CSV File System(*)\*" "\Cluster CSV Volume Cache(*)\*" "\Cluster CSV Volume Manager(*)\*" "\Cluster CSVFS(*)\*" "\Cluster Storage Cache Stores(*)\*" "\Cluster Storage Hybrid Disks(*)\*" "\Hyper-V Hypervisor Logical Processor(*)\*" "\Hyper-V Hypervisor Partition(*)\*" "\Hyper-V Hypervisor Root Partition(*)\*" "\Hyper-V Hypervisor Root Virtual Processor(*)\*" "\Hyper-V Hypervisor Virtual Processor(*)\*" "\Hyper-V Virtual IDE Controller (Emulated)(*)\*" "\Hyper-V Virtual Storage Device(*)\*" "\LogicalDisk(*)\*" "\Memory\*" "\Network Adapter(*)\*" "\Paging File(*)\*" "\PhysicalDisk(*)\*" "\Process(*)\*" "\Processor Information(*)\*" "\RDMA Activity(*)\*" "\ReFS(*)\*" "\SMB Client Shares(*)\*" "\SMB Direct Connection(*)\*" "\SMB Server\*" "\SMB Server Sessions(*)\*" "\SMB Server Shares(*)\*" "\Storage Spaces Drt(*)\*" "\Storage Spaces Virtual Disk(*)\*" "\Storage Spaces Write Cache(*)\*" "\System\*" -si 00:00:02)"+"$(logman start Full-Short)"}}


這會在叢集的每個節點上建立 perfmon 計數器,並啟動 perfmon 日誌記錄。一旦經過足夠的時間遇到效能問題,請使用下列命令停止 perfmon

#Stop logmasn trace
(Get-ClusterNode).Name | % {Invoke-Command -ComputerName $_ -ScriptBlock {"$(logman stop Full-Short)"}}



收集所有需要的 perfmon 資料後,請使用下列命令移除 perfmon 計數器:

#Remove logman trace
(Get-ClusterNode).Name | % {Invoke-Command -ComputerName $_ -ScriptBlock {"$(logman Delete Full-Short)"}}


如果需要更多記錄收集:
wpr -start CPU -start FileIO -start GeneralProfile -start MiniFilter     
(For 10 seconds when issue is happening.)
wpr -stop C:\PerfLogs\Admin\wpr.etl

受影響的產品

Microsoft Windows Server 2016, Microsoft Windows Server 2019, Microsoft Windows Server 2022, Microsoft Windows 2008 Server R2, Microsoft Windows 2008 Server Service Pack 2, Microsoft Windows 2012 Server, Microsoft Windows 2012 Server R2

產品

Microsoft Hyper-V™ Server 2008, Microsoft Windows Small Business Server 2008, Microsoft Windows Small Business Server 2011 Essentials, Microsoft Windows Small Business Server 2008, Microsoft Windows Essential Business Server 2008
文章屬性
文章編號: 000193585
文章類型: How To
上次修改時間: 05 9月 2025
版本:  7
向其他 Dell 使用者尋求您問題的答案
支援服務
檢查您的裝置是否在支援服務的涵蓋範圍內。