Site icon Franky's Web

Exchange 2013/2016: Event 106, error when updating a performance indicator

I hate errors in the event log, and event 106 is particularly stubborn. It occurs from time to time. Here is an example:

Source: MSExchange Common

Event ID: 106

Error updating a performance indicator. The counter name is 'Percentage of MSAUserNetID Cache hits for last minute', the category name is 'MSExchange Global Locator Processes'. Optional code: 3. exception: The exception thrown is : System.InvalidOperationException: The requested performance counter must be initialized as ReadOnly because it is not user-defined.
for System.Diagnostics.PerformanceCounter.InitializeImpl()
for System.Diagnostics.PerformanceCounter.get_RawValue()
for Microsoft.Exchange.Diagnostics.ExPerformanceCounter.set_RawValue(Int64 value)
Last worker process info : System.ArgumentException: No process with ID 7816 is executed.
for System.Diagnostics.Process.GetProcessById(Int32 processId)
for Microsoft.Exchange.Diagnostics.ExPerformanceCounter.GetLastWorkerProcessInfo()
Processes running while Performance counter failed to update:
2552 w3wp
..
0 Idle
Performance Counters Layout information: FileMappingNotFoundException for category MSExchange Global Locator Processes : Microsoft.Exchange.Diagnostics.FileMappingNotFoundException: Cound not open File mapping for name Global\netfxcustomperfcounters.1.0msexchange global locator processes. Error Details: 2
for Microsoft.Exchange.Diagnostics.FileMapping..ctor(String name, Boolean writable)
for Microsoft.Exchange.Diagnostics.PerformanceCounterMemoryMappedFile.Initialize(String fileMappingName, Boolean writable)
for Microsoft.Exchange.Diagnostics.ExPerformanceCounter.GetAllInstancesLayout(String categoryName)

Event 106 is generated for each performance indicator and generates many red errors in the event log:

I have not yet found out why the event 106 occurs from time to time, but at least I have a workaround. When the Exchange performance indicators are re-registered, everything is quiet again for the time being.

To register the performance indicators, the following small script can be executed in the Exchange Management Shell (as administrator):

add-pssnapin Microsoft.Exchange.Management.PowerShell.Setup
$perfcounters = Get-ChildItem $exinstall\setup\perf\*.xml | foreach {$_.fullname}
foreach ($perfcounter in $perfcounters)
{
	write-host $perfcounter
	New-PerfCounters -DefinitionFileName $perfcounter
}

The performance indicators are thus reloaded, which can be recognized by the event 1001:

The performance indicators for the service msexchangeumcallrouteravailability (msexchangeumcallrouteravailability) have been removed. The data contains the new values of the registry entries "Last Counter" and "Last Help".

Loading the performance counters takes a while, there are 272 on an Exchange 2016 server. Errors also occur during registration, so I assume that these are still bugs:

Exit mobile version