Query Performance issues associated with a large sized security cache

Published Jan 15 2019 10:57 AM 538 Views
Microsoft
First published on MSDN on Jun 16, 2008

In the past couple of months, SQL Server support team has come across some customers running into performance issues attributed to TokenAndPermUserStore in SQL Server 2005. This blog post attempts to compile all the information we have so far regarding this problem.

TokenAndPermUserStore is one of the many caches present in the SQL Server 2005 memory architecture. As the name implies, this cache stores various security related information used by the SQL Server Engine. If you are curious to know the different types of tokens currently cached in this cache on your server, the following query will provide you the information:

SELECT COUNT(*) as TokenCount, *

FROM

(SELECT

x.value('(//@name)[1]', 'varchar (100)') AS [Token Name],

x.value('(//@class)[1]', 'bigint') AS [Class],

x.value('(//@subclass)[1]', 'int') AS [SubClass]

FROM

(SELECT CAST (entry_data as xml)

FROM sys.dm_os_memory_cache_entries

WHERE type = 'USERSTORE_TOKENPERM')

AS R(x)

) a

GROUP BY [Token Name],[Class],[SubClass]

NOTE: Please do not run this command on a production server during peak load as it could take a while to finish depending upon the number of entries present in the cache.

The problems we have seen are specific to token type TokenAccessResult with a class of 65535. These tokens represent information about cumulative permission checks for queries. For more information on this, refer to the KB article: Queries take a longer time to finish running when the size of the TokenAndPermUserStore cache g... .

There are several indicators you can monitor to determine if you are running into this class of problems.

1.        The amount of memory used by this security token cache

2.        The number of entries present in this security token cache

3.        The extent of contention on this security token cache

To find out the amount of memory consumed by this token cache, you can query the DMV’s as follows:

SELECT SUM(single_pages_kb + multi_pages_kb) AS "SecurityTokenCacheSize(kb)"

FROM sys.dm_os_memory_clerks

WHERE name = 'TokenAndPermUserStore'

There is no specific threshold for this size beyond which the problem starts to happen. The characteristic you need to monitor is the rate at which this cache size is growing. If you are encountering problems with this cache, then you will notice that as the size of the cache grows, the nature of the problems you experience becomes worse. On a sample server that experienced this problem, the cache grew at a rate approximately 1MB per min to reach close to 1.2 GB. We have seen the problem starting to show up even when the size of this cache reaches several hundred MB.

Next, to understand if there is contention while accessing this cache, you have to execute commands like the following:

Servers running builds < SQL 2005 SP2

SET NOCOUNT ON

CREATE TABLE #spins([Spinlock Name] varchar(50),Collisions numeric,Spins numeric,[Spins/Collision] float)

INSERT INTO #spins EXECUTE ('DBCC SQLPERF (''SPINLOCKSTATS'')')

SELECT TOP 20 * FROM #spins ORDER BY Collisions DESC

DROP TABLE #spins

Servers running builds >= SQL 2005 SP2

SET NOCOUNT ON

CREATE TABLE #spins([Spinlock Name] varchar(50),Collisions numeric,Spins numeric,[Spins/Collision] float,[Sleep Time (ms)] numeric,Backoffs numeric)

INSERT INTO #spins EXECUTE ('DBCC SQLPERF (''SPINLOCKSTATS'')')

SELECT TOP 20 * FROM #spins ORDER BY Collisions DESC

DROP TABLE #spins

In this output, the row you need to pay attention to is the following one:


Spinlock Name


Collisions


Spins


Spins/Collision


Sleep Time (ms)


Backoffs


MUTEX


7,714,984


1,020,994,305,589


132,339


55,000,343


101,024,820


MUTEX


8,143,896


1,055,469,534,588


129,603


61,055,906


104,387,627

This sample output was captured across 30 minute duration on a server experiencing this problem. Basically this output shows that various threads inside the SQL Server process is contending for a spinlock named MUTEX. The values above are various attributes that indicate the extent and nature of contention. Spinlock is a very lightweight synchronization mechanism used with the SQL Server engine. Depending upon the data structure that a particular spinlock protects, it is given a unique name within the SQL Engine. MUTEX is the name of the spinlock which protects the security token cache (among a few other things) that we are discussing here. Very similar to the size, what you want to monitor is the rate at which the various values here increase.

The symptoms that you want to co


%3CLINGO-SUB%20id%3D%22lingo-sub-315494%22%20slang%3D%22en-US%22%3EQuery%20Performance%20issues%20associated%20with%20a%20large%20sized%20security%20cache%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-315494%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Jun%2016%2C%202008%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EIn%20the%20past%20couple%20of%20months%2C%20SQL%20Server%20support%20team%20has%20come%20across%20some%20customers%20running%20into%20performance%20issues%20attributed%20to%20TokenAndPermUserStore%20in%20SQL%20Server%202005.%20This%20blog%20post%20attempts%20to%20compile%20all%20the%20information%20we%20have%20so%20far%20regarding%20this%20problem.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ETokenAndPermUserStore%20is%20one%20of%20the%20many%20caches%20present%20in%20the%20SQL%20Server%202005%20memory%20architecture.%20As%20the%20name%20implies%2C%20this%20cache%20stores%20various%20security%20related%20information%20used%20by%20the%20SQL%20Server%20Engine.%20If%20you%20are%20curious%20to%20know%20the%20different%20types%20of%20tokens%20currently%20cached%20in%20this%20cache%20on%20your%20server%2C%20the%20following%20query%20will%20provide%20you%20the%20information%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESELECT%20COUNT(*)%20as%20TokenCount%2C%20*%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EFROM%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E(SELECT%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Ex.value('(%2F%2F%40name)%5B1%5D'%2C%20'varchar%20(100)')%20AS%20%5BToken%20Name%5D%2C%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Ex.value('(%2F%2F%40class)%5B1%5D'%2C%20'bigint')%20AS%20%5BClass%5D%2C%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3Ex.value('(%2F%2F%40subclass)%5B1%5D'%2C%20'int')%20AS%20%5BSubClass%5D%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EFROM%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E(SELECT%20CAST%20(entry_data%20as%20xml)%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EFROM%20sys.dm_os_memory_cache_entries%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EWHERE%20type%20%3D%20'USERSTORE_TOKENPERM')%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EAS%20R(x)%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E)%20a%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EGROUP%20BY%20%5BToken%20Name%5D%2C%5BClass%5D%2C%5BSubClass%5D%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ENOTE%3A%20Please%20do%20not%20run%20this%20command%20on%20a%20production%20server%20during%20peak%20load%20as%20it%20could%20take%20a%20while%20to%20finish%20depending%20upon%20the%20number%20of%20entries%20present%20in%20the%20cache.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20problems%20we%20have%20seen%20are%20specific%20to%20token%20type%20TokenAccessResult%20with%20a%20class%20of%2065535.%20These%20tokens%20represent%20information%20about%20cumulative%20permission%20checks%20for%20queries.%20For%20more%20information%20on%20this%2C%20refer%20to%20the%20KB%20article%3A%20%3CA%20href%3D%22http%3A%2F%2Fsupport.microsoft.com%2Fdefault.aspx%3Fscid%3Dkb%3BEN-US%3B927396%22%20mce_href%3D%22http%3A%2F%2Fsupport.microsoft.com%2Fdefault.aspx%3Fscid%3Dkb%3BEN-US%3B927396%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Queries%20take%20a%20longer%20time%20to%20finish%20running%20when%20the%20size%20of%20the%20TokenAndPermUserStore%20cache%20grows%20in%20SQL%20Server%202005%20%3C%2FA%3E%20.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EThere%20are%20several%20indicators%20you%20can%20monitor%20to%20determine%20if%20you%20are%20running%20into%20this%20class%20of%20problems.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E1.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20amount%20of%20memory%20used%20by%20this%20security%20token%20cache%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E2.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20number%20of%20entries%20present%20in%20this%20security%20token%20cache%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E3.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20extent%20of%20contention%20on%20this%20security%20token%20cache%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ETo%20find%20out%20the%20amount%20of%20memory%20consumed%20by%20this%20token%20cache%2C%20you%20can%20query%20the%20DMV%E2%80%99s%20as%20follows%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESELECT%20SUM(single_pages_kb%20%2B%20multi_pages_kb)%20AS%20%22SecurityTokenCacheSize(kb)%22%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EFROM%20sys.dm_os_memory_clerks%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EWHERE%20name%20%3D%20'TokenAndPermUserStore'%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EThere%20is%20no%20specific%20threshold%20for%20this%20size%20beyond%20which%20the%20problem%20starts%20to%20happen.%20The%20characteristic%20you%20need%20to%20monitor%20is%20the%20rate%20at%20which%20this%20cache%20size%20is%20growing.%20If%20you%20are%20encountering%20problems%20with%20this%20cache%2C%20then%20you%20will%20notice%20that%20as%20the%20size%20of%20the%20cache%20grows%2C%20the%20nature%20of%20the%20problems%20you%20experience%20becomes%20worse.%20On%20a%20sample%20server%20that%20experienced%20this%20problem%2C%20the%20cache%20grew%20at%20a%20rate%20approximately%201MB%20per%20min%20to%20reach%20close%20to%201.2%20GB.%20We%20have%20seen%20the%20problem%20starting%20to%20show%20up%20even%20when%20the%20size%20of%20this%20cache%20reaches%20several%20hundred%20MB.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ENext%2C%20to%20understand%20if%20there%20is%20contention%20while%20accessing%20this%20cache%2C%20you%20have%20to%20execute%20commands%20like%20the%20following%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EServers%20running%20builds%20%26lt%3B%20SQL%202005%20SP2%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESET%20NOCOUNT%20ON%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ECREATE%20TABLE%20%23spins(%5BSpinlock%20Name%5D%20varchar(50)%2CCollisions%20numeric%2CSpins%20numeric%2C%5BSpins%2FCollision%5D%20float)%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EINSERT%20INTO%20%23spins%20EXECUTE%20('DBCC%20SQLPERF%20(''SPINLOCKSTATS'')')%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESELECT%20TOP%2020%20*%20FROM%20%23spins%20ORDER%20BY%20Collisions%20DESC%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EDROP%20TABLE%20%23spins%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EServers%20running%20builds%20%26gt%3B%3D%20SQL%202005%20SP2%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESET%20NOCOUNT%20ON%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ECREATE%20TABLE%20%23spins(%5BSpinlock%20Name%5D%20varchar(50)%2CCollisions%20numeric%2CSpins%20numeric%2C%5BSpins%2FCollision%5D%20float%2C%5BSleep%20Time%20(ms)%5D%20numeric%2CBackoffs%20numeric)%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EINSERT%20INTO%20%23spins%20EXECUTE%20('DBCC%20SQLPERF%20(''SPINLOCKSTATS'')')%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3ESELECT%20TOP%2020%20*%20FROM%20%23spins%20ORDER%20BY%20Collisions%20DESC%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EDROP%20TABLE%20%23spins%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EIn%20this%20output%2C%20the%20row%20you%20need%20to%20pay%20attention%20to%20is%20the%20following%20one%3A%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CTABLE%3E%0A%20%20%20%3CTBODY%3E%3CTR%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Spinlock%20Name%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Collisions%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Spins%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Spins%2FCollision%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Sleep%20Time%20(ms)%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Backoffs%20%3C%2FB%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3EMUTEX%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E7%2C714%2C984%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E1%2C020%2C994%2C305%2C589%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E132%2C339%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E55%2C000%2C343%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E101%2C024%2C820%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3EMUTEX%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E8%2C143%2C896%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E1%2C055%2C469%2C534%2C588%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E129%2C603%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E61%2C055%2C906%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E104%2C387%2C627%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%3CP%3E%3C%2FP%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%3C%2FTBODY%3E%3C%2FTABLE%3E%0A%20%20%3CP%3EThis%20sample%20output%20was%20captured%20across%2030%20minute%20duration%20on%20a%20server%20experiencing%20this%20problem.%20Basically%20this%20output%20shows%20that%20various%20threads%20inside%20the%20SQL%20Server%20process%20is%20contending%20for%20a%20spinlock%20named%20MUTEX.%20The%20values%20above%20are%20various%20attributes%20that%20indicate%20the%20extent%20and%20nature%20of%20contention.%20Spinlock%20is%20a%20very%20lightweight%20synchronization%20mechanism%20used%20with%20the%20SQL%20Server%20engine.%20Depending%20upon%20the%20data%20structure%20that%20a%20particular%20spinlock%20protects%2C%20it%20is%20given%20a%20unique%20name%20within%20the%20SQL%20Engine.%20MUTEX%20is%20the%20name%20of%20the%20spinlock%20which%20protects%20the%20security%20token%20cache%20(among%20a%20few%20other%20things)%20that%20we%20are%20discussing%20here.%20Very%20similar%20to%20the%20size%2C%20what%20you%20want%20to%20monitor%20is%20the%20rate%20at%20which%20the%20various%20values%20here%20increase.%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20symptoms%20that%20you%20want%20to%20co%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-315494%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jun%2016%2C%202008%20In%20the%20past%20couple%20of%20months%2C%20SQL%20Server%20support%20team%20has%20come%20across%20some%20customers%20running%20into%20performance%20issues%20attributed%20to%20TokenAndPermUserStore%20in%20SQL%20Server%202005.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-315494%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPerformance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jan 15 2019 10:57 AM
Updated by: