Freigeben über


Monitoringhost.exe is consuming high cpu load on SQL

Hi all,

MonitoringHost.exe is consuming 100% CPU and blocking the SQL server in some cases.

We’ve seen this high load on machines with a SQL installation in combination with the OpsMgr SQL management pack.

This issue is already addressed to the product group and they are going to fix this issue in the future.

Until the fix has released there exist a workaround, which can be applied to all SCOM managed SQL Machines independently of the OS.

 

You can find more details under:

https://msdn.microsoft.com/en-us/library/ee809360.aspx

Hosting-related Registration Keys:

Some default aspects of script execution and behavior in Operations Manager-hosted Windows PowerShell scripts can be customized by setting registry keys. These values can be found in the following node in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global\PowerShell

 

The following table shows the registry keys used to control script execution behavior for Windows PowerShell scripts run from an Operations Manager module:

Key Description Default Value

ScriptLimit

Controls how many hosted Windows PowerShell scripts are allowed to run globally. 0x00000014

IsolationLevel

Specifies whether a separate AppDomain will be used for each script. A value of 1 indicates that a separate AppDomain is used for each script.

0x00000000

 

 

You have many ways to accomplish this. Maybe as a .reg file like this:

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global\Powershell]

"ScriptLimit"=dword:00000014

"IsolationLevel"=dword:00000000

 

Or maybe with .ps1 file like this:

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global" -Name Powershell –Force

new-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global\Powershell" -name IsolationLevel` -value 0 -force -PropertyType DWORD

new-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Modules\Global\Powershell" -name ScriptLimit` -value 14 -force -PropertyType DWORD

 

Big thanks to Stefan Wuchenauer for sharing this information!