MSSQL 2017 on Linux: Total amount of granted memory in the resource pool (KB)

Microsoft.SQLServer.2017.Linux.CollectionRule.ResourcePool.ActiveMemoryGrantsCount (Rule)

Collects the Linux "Active memory grants count" performance counter for each resource pool of SQL 2017 DB Engine.

Knowledge Base article:

Summary

The rule collects the Linux "Active memory grants count" performance counter for each resource pool of SQL 2017 DB Engine.

Please refer to the description of sys.dm_exec_query_memory_grants for more details.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Timeout for database connection (seconds)

The workflow will fail and register an event, if it cannot access the database during the specified period.

15

Element properties:

TargetMicrosoft.SQLServer.2017.Linux.ResourcePool
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.2017.Linux.DataSource.SqlOsPerformanceReader Default
Mapper ConditionDetection System.Performance.DataGenericMapper Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.2017.Linux.CollectionRule.ResourcePool.ActiveMemoryGrantsCount" Target="SQL2017LD!Microsoft.SQLServer.2017.Linux.ResourcePool" Enabled="true">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2017.Linux.DataSource.SqlOsPerformanceReader">
<MachineName>$Target/Host/Host/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Host/Host/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Host/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.DBEngine"]/ConnectionString$</ConnectionString>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>900</IntervalSeconds>
<ObjectName>$Target/Host/Host/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.DBEngine"]/PerformanceCounterObject$:Resource Pool Stats</ObjectName>
<PerfInstanceName>$Target/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.ResourcePool"]/Name$</PerfInstanceName>
<PerfParams>
<NameOfHandler>SqlOsPerfCounterReader</NameOfHandler>
<PerformanceCounterObject>$Target/Host/Host/Property[Type="SQL2017L!Microsoft.SQLServer.2017.Library.DBEngine"]/PerformanceCounterObject$</PerformanceCounterObject>
<CounterConfig>
<CategoryName>Resource Pool Stats</CategoryName>
<CounterName>Active memory grants count</CounterName>
<BaseCounterName/>
<InstanceSelector>0</InstanceSelector>
<NeedsPrefix>1</NeedsPrefix>
<InstanceIndex>0</InstanceIndex>
</CounterConfig>
</PerfParams>
</DataSource>
</DataSources>
<ConditionDetection ID="Mapper" TypeID="SystemPerf!System.Performance.DataGenericMapper">
<ObjectName>SQL Resource Pool:Resource Pool Stats</ObjectName>
<CounterName>Active memory grants count</CounterName>
<InstanceName/>
<Value>$Data/Property[@Name='CounterValue']$</Value>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>