扬州网站开发,win 2012 iis 默认网站,wordpress 页面编辑,杭州建设企业网站症状
使用性能监视器工具时#xff0c;某些计数器可能缺失或不包含计数器数据。 性能计数器库可能已损坏#xff0c;需要重新生成。
应用程序日志中可能会出现以下错误#xff1a;
Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-PerfCounters
Event ID…症状
使用性能监视器工具时某些计数器可能缺失或不包含计数器数据。 性能计数器库可能已损坏需要重新生成。
应用程序日志中可能会出现以下错误
Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-PerfCounters
Event ID: 2002
Level: Error
Keywords: Classic
Description:
Setting up Web Service counters failed, please make sure your Web Service counters are registered correctly.
Log Name: Application
Source: IISInfoCtrs
Event ID: 1001
Level: Error
Keywords: Classic
Description:
Unable to read the first counter index value from the registry. The error code returned by the registry is data DWORD 0.
原因
如果某些可扩展计数器损坏注册表或者 Windows Management Instrumentation (基于 WMI) 的程序修改注册表则可能会发生此行为。
解决方案
若要解决此问题请使用以下方法。
确保注册表中不会禁用计数器
可以通过注册表设置禁用计数器。 检查以下注册表位置确保计数器未被禁用
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\%servicename%\Performance !备注
%servicename% 表示具有性能计数器的任何服务。 例如PerfDisk、PerfOS 等。
这些位置中的任何一个都可能有 DisablePerformanceCounters 的注册表项。 根据 “禁用性能计数器”一文此值应设置为 0。 如果该值是除 0 以外的任何值则可能会禁用计数器。
值为 1 表示已禁用计数器。值 2 表示禁用 32 位计数器。值为 4 表示禁用 64 位计数器。
重新生成所有性能计数器包括可扩展计数器和第三方计数器
若要重新生成所有性能计数器包括可扩展计数器和第三方计数器请在管理命令提示符处键入以下命令。 在每个命令之后按 ENTER 。 重新生成计数器 cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R 使用 Windows Management Instrumentation (WMI) 重新同步计数器 WINMGMT.EXE /RESYNCPERF 停止并重启性能日志和警报服务。 Get-Service -Name pla | Restart-Service -Verbose 停止并重启 Windows Management Instrumentation 服务。 Get-Service -Name winmgmt | Restart-Service -Force -Verbose 创建新的数据收集器集 (不使用现有的数据收集器集) 。
有时运行 lodctr /R 可能不会恢复所有计数器。 如果注意到这种情况发生请验证文件 c:\windows\system32\PerfStringBackup.INI 是否包含正确的信息。 可以从相同的计算机复制此文件以还原计数器。 从计算机到计算机此文件可能略有不同。 但是如果发现大小存在巨大差异则可能缺少信息。 在替换之前请始终创建备份副本。 不能保证从另一台计算机复制此文件将还原所有计数器。 如果可能请将该文件与计算机的备份进行比较以查看文件大小是否在某个时间点缩小。
对于许多计数器要安装 perf 计数器的 ini 文件的位置位于下面 windows\winsxs例如 IIS 的 ini 文件。
如果看到以下错误
Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-PerfCounters
Event ID: 2002
Level: Error
Keywords: Classic
Description:
Setting up Web Service counters failed, please make sure your Web Service counters are registered correctly.
Log Name: Application
Source: IISInfoCtrs
Event ID: 1001
Level: Error
Keywords: Classic
Description:
Unable to read the first counter index value from the registry. The error code returned by the registry is data DWORD 0.
需要在目录 c:\Windows\winsxs中使用计数器安装 ini 文件。
需要修复的计数器可能存在多个文件夹。 在这些情况下可能需要使用试用和错误来查找正确的 ini 文件。
例如
Dir C:\Windows\winsxs\amd64_microsoft-windows-iis-metabase*
在此示例中尝试使用以下方法从每个文件夹安装infoctrs.ini
Lodtr infoctrs.ini
成功后将在应用程序日志中看到以下条目
Log Name: Application
Source: Microsoft-Windows-LoadPerf
Event ID: 1000
Level: Information
Description:
Performance counters for the inetinfo (inetinfo) service were loaded successfully. The Record Data in the data section contains the new index values assigned to this service.
需要对以下计数器执行相同的操作
amd64_microsoft-windows-iis-w3svc*
lodctr w3ctrs.ini
之后你将看到
Log Name: Application
Source: Microsoft-Windows-LoadPerf
Event ID: 1000
Level: Information
Description:
Performance counters for the W3SVC (World Wide Web Publishing Service) service were loaded successfully. The Record Data in the data section contains the new index values assigned to this service.