The #1 reason performance counter does not work is because the app do not have permission to read perf counter. It should be documented here how to check this, and how to grant permissions to performance counter.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@cijothomas Thank you very much for pointing this out. I'll assign this to the author so they can update our documentation.
For me that was because my pool was running under the ApplicationPoolIdentity account. Changing it to "LocalSystem" fixed it.
You can also add your pool to the performance monitor group :
net localgroup "Performance Monitor Users" /add "IIS APPPOOL\NameOfYourPool"
Restarting pool+app doesn't work, you need to call the iisreset command instead.
Most helpful comment
For me that was because my pool was running under the ApplicationPoolIdentity account. Changing it to "LocalSystem" fixed it.
You can also add your pool to the performance monitor group :
net localgroup "Performance Monitor Users" /add "IIS APPPOOL\NameOfYourPool"
Restarting pool+app doesn't work, you need to call the iisreset command instead.