Calculating false contention percentages with the Db2 statistics trace

You can use the Db2 statistics trace to calculate false contention percentages.

Procedure

To calculate false contention with the Db2 statistics trace:

  1. Determine the number of suspends that are caused by false contention.
  2. Determine the total number of requests that went to XES.
  3. Divide the number of suspends that are caused by false contention by the total number of requests that went to XES.
  4. Multiply the result by 100.

Example

Figure 1. Data sharing locking block of IBM® OMEGAMON® for Db2 Performance Expert on z/OS® statistics trace
DATA SHARING LOCKING            QUANTITY  /SECOND  /THREAD  /COMMIT
---------------------------     --------  -------  -------  -------
GLOBAL CONTENTION RATE (%)          0.19
FALSE CONTENTION RATE (%)           0.04
P/L-LOCKS XES RATE (%)             36.47

LOCK REQUESTS (P-LOCKS)           107.4K    44.74     0.93     0.18
UNLOCK REQUESTS (P-LOCKS)         105.2K    43.82     0.91     0.18
CHANGE REQUESTS (P-LOCKS)        1453.00     0.61     0.01     0.00

SYNCH.XES - LOCK REQUESTS        1478.8K   616.16    12.77     2.48
SYNCH.XES - CHANGE REQUESTS     45450.00    18.94     0.39     0.08
SYNCH.XES - UNLOCK REQUESTS       810.0K   337.48     7.00     1.36
BACKGROUND.XES -CHILD LOCKS         0.00     0.00     0.00     0.00
ASYNCH.XES -CONVERTED LOCKS       108.00     0.04     0.00     0.00

SUSPENDS - IRLM GLOBAL CONT      3236.00     1.35     0.03     0.01
SUSPENDS - XES GLOBAL CONT.       334.00     0.14     0.00     0.00
SUSPENDS - FALSE CONT. MBR        863.00     0.36     0.01     0.00
SUSPENDS - FALSE CONT. LPAR          N/A      N/A      N/A      N/A
REJECTED - XES                  31897.00    13.29     0.28     0.05
INCOMPATIBLE RETAINED LOCK          0.00     0.00     0.00     0.00
NOTIFY MESSAGES SENT              344.00     0.14     0.00     0.00
NOTIFY MESSAGES RECEIVED          106.00     0.04     0.00     0.00
P-LOCK/NOTIFY EXITS ENGINES       500.00      N/A      N/A      N/A
P-LCK/NFY EX.ENGINE UNAVAIL         0.00     0.00     0.00     0.00

PSET/PART P-LCK NEGOTIATION        38.00     0.02     0.00     0.00
PAGE P-LOCK NEGOTIATION          3026.00     1.26     0.03     0.01
OTHER P-LOCK NEGOTIATION         1520.00     0.63     0.01     0.00
P-LOCK CHANGE DURING NEG.        3072.00     1.28     0.03     0.01

For this example statistics trace, calculate the false contention as follows:

Determine the total number of suspends that are caused by false contention (SUSPENDS - FALSE CONT. LPAR).
863
Determine the total number of requests that went to XES (SYNCH.XES LOCK REQUESTS + CHANGE REQUESTS + UNLOCK REQUESTS + BACKGROUND.XES CHILD LOCKS + ASYNCH.XES CONVERTED LOCKS + SUSPENDS IRLM GLOBAL CONT + XES GLOBAL CONT. + FALSE CONT. LPAR).
1478800 + 45450 + 810000 + 0 + 108 + 3236 + 334 + 863 = 2338791
Divide the number of suspends that are caused by false contention by the total number of requests that went to XES.
863 / 2338791 = .0004
Multiply the result by 100.
.0004 × 100 = .04

False contention is approximately 0.04% of the total number of requests that went to XES.