Locking Activity
This topic shows detailed information about Statistics - Locking
Activity
.
Statistics - Locking Activity
The field labels shown in the following sample layout of Statistics - Locking Activity
are
described in the following section.
LOCKING ACTIVITY QUANTITY /SECOND /THREAD /COMMIT
--------------------------- -------- ------- ------- -------
SUSPENSIONS (ALL) 15.00 0.08 N/C 0.45
SUSPENSIONS (LOCK ONLY) 0.00 0.00 N/C 0.00
SUSPENSIONS (IRLM LATCH) 15.00 0.08 N/C 0.45
SUSPENSIONS (OTHER) 0.00 0.00 N/C 0.00
TIMEOUTS 0.00 0.00 N/C 0.00
DEADLOCKS 0.00 0.00 N/C 0.00
LOCK REQUESTS 11626.00 63.96 N/C 352.30
UNLOCK REQUESTS 2745.00 15.10 N/C 83.18
QUERY REQUESTS 0.00 0.00 N/C 0.00
CHANGE REQUESTS 389.00 2.14 N/C 11.79
OTHER REQUESTS 0.00 0.00 N/C 0.00
LOCK ESCALATION (SHARED) 0.00 0.00 N/C 0.00
LOCK ESCALATION (EXCLUSIVE) 0.00 0.00 N/C 0.00
DRAIN REQUESTS 7.00 0.04 N/C 0.21
DRAIN REQUESTS FAILED 0.00 0.00 N/C 0.00
CLAIM REQUESTS 999.00 5.50 N/C 30.27
CLAIM REQUESTS FAILED 0.00 0.00 N/C 0.00
CONDITIONAL LOCK FAILURES 0.00 0.00 N/C 0.00
UNCONDITIONAL LOCK RETRIES 0.00 0.00 N/C 0.00
- SUSPENSIONS (ALL)
-
The total number of suspensions.
Field Name: SLRSUSP
- SUSPENSIONS (LOCK ONLY)
-
The number of times a lock could not be obtained and the unit of work was suspended.
Background and Tuning Information
This number should be low, ideally 0.
The number of lock suspensions is a function of the lock requests. Lock suspensions (or conflicts) can happen on either LOCK REQUEST or CHANGE REQUEST.
Suspensions are highly dependent on the application and table space locking protocols.
Field Name: QTXASLOC
This is an exception field.
- SUSPENSIONS (IRLM LATCH)
-
The number of latch suspensions.
Field Name: QTXASLAT
This is an exception field.
- SUSPENSIONS (OTHER)
-
The number of suspensions caused by something other than lock or latch.
Field Name: QTXASOTH
This is an exception field.
- TIMEOUTS
-
The number of times a unit of work was suspended for a time exceeding the timeout value. This number should be low, ideally 0.
Field Name: QTXATIM
This is an exception field.
- DEADLOCKS
-
The number of times deadlocks were detected. This number should be low, ideally 0.
Background and Tuning Information
Deadlocks occur when two or more application processes each hold locks on resources that the others need, without which they cannot proceed. Ensure that all applications accessing the same tables access them in the same order.
To improve concurrency:- Use row level locking instead of page level locking to minimize deadlocks.
- For small tables use page level locking with MAXROWS 1.
- Delay updates to just before commit.
- Use SELECT with the FOR UPDATE clause to use U lock.
- Adjust the deadlock detection cycle parameter DEADLOK in the IRLM procedure.
This field is incremented once for each deadlock encountered. There is no correlation between this field and the deadlock events reported in the Locking report set or the number of IFCID 172 records written. This field reports all deadlocks, regardless of how they were resolved. The locking report and record trace IFCID 172 show only those deadlocks that were resolved by Db2.
Field Name: QTXADEA
This is an exception field.
- LOCK REQUESTS
-
The number of requests to lock a resource.
Field Name: QTXALOCK
This is an exception field.
- UNLOCK REQUESTS
-
The number of requests to unlock a resource.
This value can be less than the number of lock requests because Db2 can release several locks with a single unlock request.
Field Name: QTXAUNLK
- QUERY REQUESTS
-
The number of query requests.
Field Name: QTXAQRY
- CHANGE REQUESTS
-
The number of change requests.
Field Name: QTXACHG
- OTHER REQUESTS
-
The number of requests to IRLM to perform a function other than LOCK, UNLOCK, QUERY, or CHANGE.
Field Name: QTXAIRLM
- LOCK ESCALATION (SHARED)
-
The number of times the maximum page locks per table space are exceeded, and the table space lock escalates from a page lock (IS) to a table space lock (S) for this thread. You can specify the number of locks allowed per table space with the LOCKS PER TABLE(SPACE) parameter on the Db2 install panel DSNTIPJ.
Background and Tuning Information
Escalations can cause unpredictable response times. Lock escalations should only happen when an application process updates or references (if repeatable read is used) more pages than normal.
Field Name: QTXALES
This is an exception field.
- LOCK ESCALATION (EXCLUSIVE)
-
The number of times the maximum page locks per table space are exceeded and the table space lock escalates from a page lock (IX) to a table space lock (X).
Background and Tuning Information
Escalations can cause unpredictable response times. Lock escalations should only happen when an application process updates or references (if repeatable read is used) more pages than it normally does.
A useful rule of thumb is to compare the number of escalations (shared and exclusive) to the successful escalations (those that did not cause deadlocks and timeouts). If this value, or the number Lock escalations - shared and if the number of timeouts or deadlocks is also not 0, the timeout or deadlock is probably caused by the escalation.
If many escalations cause deadlocks and timeouts, the recommendation is to change the escalation threshold value. Use of ANY is extremely useful to prevent unnecessary and expensive page locks, for example locking all pages in a tablespace.
Lock escalations, shared or exclusive, should not be expected in a transaction environment.
Field Name: QTXALEX
This is an exception field.
- DRAIN REQUESTS
-
The number of drain requests.
Field Name: QTXADRNO
This is an exception field.
- DRAIN REQUESTS FAILED
-
The number of unsuccessful drain requests.
Field Name: QTXADRUN
This is an exception field.
- CLAIM REQUESTS
-
The number of claim requests.
Field Name: QTXACLNO
This is an exception field.
- CLAIM REQUESTS FAILED
-
The number of unsuccessful claim requests.
Field Name: QTXACLUN
This is an exception field.
- CONDITIONAL LOCK FAILURES
-
The number of failed conditional lock requests that occurred during an INSERT operation.
Field Name: QISTCONDLKF
- UNCONDITIONAL LOCK RETRIES
-
The number of times a failed conditional lock request has been retried with an unconditional lock request.
Field Name: QISTRETRYLK