Number of Deadlocks/sec - value increase high?

  • Hi..

    I have checked one of the production server.. by uisng below script

    select cntr_value AS NumOfDeadLocks

    FROM sys.dm_os_performance_counters

    WHERE object_name = 'SQLServer:Locks'

    AND counter_name = 'Number of Deadlocks/sec'

    AND instance_name = '_Total'

    output - 400, then restart services this value become zero after this counter value increase more and more

    Pl. confirm..what could be meaning this counter values, is it really happend deadlock issue?

    should I enable trace falg 1204, 1222, 3605 for capture deadlock event?

    Thanks

    ananda

  • As per Books Online:

    For per-second counters, this value is cumulative. The rate value must be calculated by sampling the value at discrete time intervals. The difference between any two successive sample values is equal to the rate for the time interval used.

    So what you're seeing there is the cumulative (total) number of deadlocks that you've had.

    If you want to see the number per time interval, then, as per BoL, you need to query that at multiple times and take the difference to see the number of deadlocks in the period of time between the two samples.

    If you want to investigate the deadlocks further, switch traceflag 1222 on (not 1204, not 3605). That will result in a deadlock graph been written to the error log every time a deadlock occurs. Post the result of that graph here if you want help with the analysis.

    DBCC TRACEON(1222,-1)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Since you're running SQL Server 2008, you can get the deadlock information out of the system_health extended event session without ever setting a traceflag. Here's an introduction to the system_health session.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you for reply..

    Server OS - win 2008 Ent.edition

    Database - SQL 2008 standard edition with sp1.. not updated any culmative patch and sp3.

    I have switch on tace falg 1222 on server... after that deadlock graph not storing at error log..it means currently not deadlock happend

    so, i m waiting and monitoring at error log file for deadlock info, I should post result for further analysis, .. once getting result.

    Is it possible restet the counter values 0?, it is showing cumlative number 258

  • re-attach that error file

    Date,Source,Severity,Message

    04/06/2013 15:07:45,spid18s,Unknown,waiter id=process3f66c70 mode=X requestType=convert

    04/06/2013 15:07:45,spid18s,Unknown,waiter-list

    04/06/2013 15:07:45,spid18s,Unknown,owner id=process3e99390 mode=S

    04/06/2013 15:07:45,spid18s,Unknown,owner-list

    04/06/2013 15:07:45,spid18s,Unknown,keylock hobtid=72057594039566336 dbid=18 objectname=LRModel.dbo.Constraints indexname=PK_Constraints id=lock515a2800 mode=U associatedObjectId=72057594039566336

    04/06/2013 15:07:45,spid18s,Unknown,waiter id=process3e99390 mode=S requestType=wait

    04/06/2013 15:07:45,spid18s,Unknown,waiter-list

    04/06/2013 15:07:45,spid18s,Unknown,owner id=process3f66c70 mode=RangeX-X

    04/06/2013 15:07:45,spid18s,Unknown,owner-list

    04/06/2013 15:07:45,spid18s,Unknown,keylock hobtid=72057594052214784 dbid=18 objectname=LRModel.dbo.Equipment_Constraints_Association indexname=IX_Equipment_Constraints_Association_Constraint_PK_ID id=lock40a89280 mode=RangeX-X associatedObjectId=72057594052214784

    04/06/2013 15:07:45,spid18s,Unknown,resource-list

    04/06/2013 15:07:45,spid18s,Unknown,where ((((([Constraint_PK_ID] = @0) and ([Application_PK_ID] = @1)) and ([HighChangeNote_PK_ID] = @2)) and ([Type_PK_ID] = @3)) and ([UOM_PK_ID] = @4))

    04/06/2013 15:07:45,spid18s,Unknown,(@0 uniqueidentifier<c/>@1 uniqueidentifier<c/>@2 uniqueidentifier<c/>@3 uniqueidentifier<c/>@4 uniqueidentifier)delete [dbo].[Constraints]

    04/06/2013 15:07:45,spid18s,Unknown,inputbuf

    04/06/2013 15:07:45,spid18s,Unknown,unknown

    04/06/2013 15:07:45,spid18s,Unknown,frame procname=unknown line=1 sqlhandle=0x000000000000000000000000000000000000000000000000

    04/06/2013 15:07:45,spid18s,Unknown,where ((((([Constraint_PK_ID] = @0) and ([Application_PK_ID] = @1)) and ([HighChangeNote_PK_ID] = @2)) and ([Type_PK_ID] = @3)) and ([UOM_PK_ID] = @4))

    04/06/2013 15:07:45,spid18s,Unknown,delete [dbo].[Constraints]

    04/06/2013 15:07:45,spid18s,Unknown,frame procname=adhoc line=1 stmtstart=202 sqlhandle=0x020000006981d42b9fc4ed87a90fe5b7dd352940763a0d23

    04/06/2013 15:07:45,spid18s,Unknown,DELETE [dbo].[ConstraintHighValues] WHERE [Constraint_PK_ID] in (select Constraint_PK_ID from deleted)

    04/06/2013 15:07:45,spid18s,Unknown,frame procname=LRModel.dbo.TR_DEL_Constraints line=3 stmtstart=422 stmtend=630 sqlhandle=0x030012003029c107643bc200c9a000000000000000000000

    04/06/2013 15:07:45,spid18s,Unknown,where Constraint_PK_ID in (select Constraint_PK_ID from DELETED)

    04/06/2013 15:07:45,spid18s,Unknown,UPDATE [dbo].[Constraints] set [ModifiedTime] = GetUtcDate()

    04/06/2013 15:07:45,spid18s,Unknown,frame procname=LRModel.dbo.TR_LR_DEL_ConstraintHighValues line=4 stmtstart=222 stmtend=488 sqlhandle=0x03001200feeee142843cc200c9a000000000000000000000

    04/06/2013 15:07:45,spid18s,Unknown,executionStack

    04/06/2013 15:07:45,spid18s,Unknown,process id=process3f66c70 taskpriority=0 logused=73760 waitresource=KEY: 18:72057594039566336 (dd01d37fbdfb) waittime=3278 ownerId=50976918 transactionname=user_transaction lasttranstarted=2013-04-06T15:07:40.203 XDES=0x5385ac10 lockMode=X schedulerid=14 kpid=2788 status=suspended spid=93 sbid=2 ecid=0 priority=0 trancount=2 lastbatchstarted=2013-04-06T15:07:42.087 lastbatchcompleted=2013-04-06T15:07:42.087 clientapp=.Net SqlClient Data Provider hostname=servername1 hostpid=8820 loginname=ISRV isolationlevel=serializable (4) xactid=50976918 currentdb=18 lockTimeout=4294967295 clientoption1=671219744 clientoption2=128056

    04/06/2013 15:07:45,spid18s,Unknown,Proc [Database Id = 18 Object Id = 816721962]

    04/06/2013 15:07:45,spid18s,Unknown,inputbuf

    04/06/2013 15:07:45,spid18s,Unknown,delete from Constraints where Constraint_PK_ID not in (select [CT].Constraint_PK_ID from Constraints [CT] join [Equipment_Constraints_Association] [ECA] on [CT].Constraint_PK_ID=[ECA].Constraint_PK_ID)

    04/06/2013 15:07:45,spid18s,Unknown,frame procname=LRModel.dbo.ClearSyncHistory line=6 stmtstart=274 stmtend=678 sqlhandle=0x030012002a30ae305445c200c9a000000100000000000000

    04/06/2013 15:07:45,spid18s,Unknown,executionStack

    04/06/2013 15:07:45,spid18s,Unknown,process id=process3e99390 taskpriority=0 logused=0 waitresource=KEY: 18:72057594052214784 (630409aa418f) waittime=3352 ownerId=50977905 transactionname=DELETE lasttranstarted=2013-04-06T15:07:42.010 XDES=0x58a8fd0 lockMode=S schedulerid=11 kpid=4280 status=suspended spid=134 sbid=2 ecid=0 priority=0 trancount=2 lastbatchstarted=2013-04-06T15:07:42.010 lastbatchcompleted=2013-04-06T15:07:42.010 lastattention=2013-04-06T14:33:24.943 clientapp=.Net SqlClient Data Provider hostname=servername2 hostpid=8820 loginname=ISRV isolationlevel=read committed (2) xactid=50977905 currentdb=18 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056

    04/06/2013 15:07:45,spid18s,Unknown,process-list

    04/06/2013 15:07:45,spid18s,Unknown,deadlock victim=process3e99390

    04/06/2013 15:07:45,spid18s,Unknown,deadlock-list

    04/06/2013 14:53:47,spid60,Unknown,DBCC TRACEON 1222<c/> server process ID (SPID) 60. This is an informational message only; no user action is required.

  • ananda.murugesan (4/6/2013)


    Is it possible restet the counter values 0?, it is showing cumlative number 258

    From Books online (as quoted previously)

    The rate value must be calculated by sampling the value at discrete time intervals. The difference between any two successive sample values is equal to the rate for the time interval used.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Could you seems that error log file, which I was posted

    I have ceate one table for storing output according timestamp as per that query result and schedule it every 15 min...

    thanks

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply