Perfmon is likely the first tool you think to when it comes to monitor some internals and performance of your application and it’s relatively easy to find out information and resources on the Internet; unfortunately this seems to also be a fragile component and every now and then we receive new calls about it: event log spammed with warnings about missing or corrupted counters, values returned are inconsistent or clearly wrong etc…
Messages like the following can appear after for example installing the .NET Framework 2.0 on your machine:
The Open Procedure for service "ASP.NET" in DLL "C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll" failed. Performance data for this service will not be available. Status code returned is data DWORD 0
To note that such warnings are logged even if your application is not running.
Some troubleshooting
First of all you can try to disable any third party services and processes (for example using msconfig.exe or Autoruns) and see if the problem still reproduces. If it does, you can use How to manually rebuild Performance Counter Library values to try to fix it manually, or try the following:
- Uninstall the .NET Framework 2.0
- If available for Perfc009.dat, Perfh009.dat and Perfh007.dat , Perfh007.dat, backup the registry keys
- HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\Perflib
- Open a command prompt to your System32 folder
- REN perf?009.dat *.bak
- Expand <CD_drive_letter:>\i386\perfc009.DA_ %systemroot%\system32\perfc009.DAT
- Expand <CD_drive_letter:>\i386\perfd009.DA_ %systemroot%\system32\perfd009.DAT
- Expand <CD_drive_letter:>\i386\perfh009.DA_ %systemroot%\system32\perfh009.DAT
- Expand <CD_drive_letter:>\i386\perfi009.DA_ %systemroot%\system32\perfi009.DAT
- REN perf?007.dat *.bak
- Expand <CD_drive_letter:>\i386\perfc007.DA_ %systemroot%\system32\perfc007.DAT
- Expand <CD_drive_letter:>\i386\perfd007.DA_ %systemroot%\system32\perfd007.DAT
- Expand <CD_drive_letter:>\i386\perfh007.DA_ %systemroot%\system32\perfh007.DAT
- Expand <CD_drive_letter:>\i386\perfi007.DA_ %systemroot%\system32\perfi007.DAT
- Open your system registry (be very careful!) to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib and set
- Last Counter = 1846 (decimal) or 736 (hex)
- Last Help = 1847 (decimal) or 737 (hex)
- Now move to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
- Search for the subkey Performance in services and set the values
- First Counter = 0
- First Help = 0
- Last Counter = 0
- Last Help = 0
- Back to the command prompt (still in System32)
- findstr drivername *.ini > Perfini.txt
- open Perfini.txt and note drivername=nnn
================ sample Perfini.txt :==================
C:\WINDOWS\system32\axperf.ini:drivername=ASP
C:\WINDOWS\system32\esentprf.ini:drivername=ESENT
C:\WINDOWS\system32\ftpctrs.ini:drivername=MSFTPSVC
C:\WINDOWS\system32\iasperf.ini:drivername=IAS
C:\WINDOWS\system32\infoctrs.ini:drivername=inetinfo
C:\WINDOWS\system32\mqperf.ini:drivername=MSMQ
C:\WINDOWS\system32\msdtcprf.ini:drivername=MSDTC
C:\WINDOWS\system32\ntdsctrs.ini:drivername=NTDS
C:\WINDOWS\system32\ntfrscon.ini:drivername=FileReplicaConn
C:\WINDOWS\system32\ntfrsrep.ini:drivername=FileReplicaSet
C:\WINDOWS\system32\perfci.ini:drivername=ContentIndex
C:\WINDOWS\system32\perffilt.ini:drivername=ContentFilter
C:\WINDOWS\system32\perfwci.ini:drivername=ISAPISearch
C:\WINDOWS\system32\pschdprf.ini:drivername=PSched
C:\WINDOWS\system32\rasctrs.ini:drivername=RemoteAccess
C:\WINDOWS\system32\tslabels.ini:drivername=TermService
C:\WINDOWS\system32\w3ctrs.ini:drivername=W3SVC================ Sample Perfini.txt :==================
Using this information unload und load the counter in System32:
unlodctr <drivername>
lodctr <ini file>
<drivername> driver’s name from Perfini.txt
<ini file> listed “.ini” files in Perfini.txt
Example: ASP Drivername: axperf.ini:drivername=ASP
unlodctr ASP
lodctr axperf.ini
Or using the following command you can transfer settings from a working machine to a not working one:
lodctr /s:Perf_all.ini
lodctr Perf_all.ini
Reboot
Check Perfdiag
Disable not needed counters (as a last resource)
If nothing else works as you wish or you do not want to waste time troubleshooting and just need the machine up and running without much annoyances you can disable the counters for the problematic service(s), of course at the cost of not having those data if you’ll ever need them.
For this task you can use Exctrlst.exe utility from the OS Resource Kit (see Exctrlst Overview and Exctrlst UI); it disables the specific counter by adding a registry key similar to the example below. You can add these registry entries under the specific counter entry manually if Exctrlst.exe is not available or desirable
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Spooler\Performance
Value name: Disable Performance Counters
Value type: REG_DWORD
Value data: 1
A few fixes
- FIX: An update package is available for the .NET Framework 2.0 Service Pack 1
- FIX: Event ID: 1008 occurs after you apply security update MS07-040 on a computer that has the .NET Framework 1.0 installed
- FIX: ASP.NET Performance Counters Cannot Count More Than 113 Loaded AppDomains
- FIX: The # Induced GC performance counter value increases quickly and CPU usage becomes high when you run an ASP.NET 2.0 Web application that is built on the .NET Framework 2.0
- BUG: Performance counters may have inaccurate results when a user without permission runs the ASP.NET worker process
- BUG: Installing Later Version of Common Language Runtime Creates Duplicate Performance Counters on Windows Server
- WMI warnings 35 and 40 with ASP.NET
Some How To and general articles
- ASP.NET Performance Monitoring, and When to Alert Administrators
- How to troubleshoot monitoring and logging issues for performance counters in the .NET Framework 2.0
- Troubleshooting Performance Monitor Counter Problems
- How to manually rebuild Performance Counter Library values
- HOW TO: Analyze ASP.NET Web Application Performance by Using the Performance Administration Tool
- HOW TO: Tune and Scale Performance of Applications That Are Built on the .NET Framework
- How to troubleshoot WinMgmt-based performance counter errors
- Tuning .NET Application Performance
- Improving ASP.NET performance
Carlo
Quote of the day:
The only time people dislike gossip is when you gossip about them. – Will Rogers
One Comment
Nicholas Kulkarni
findstr drivername *.ini > Perfini.txt does not work on 2012 r2 it produces a 0 byte empty file.