1 The following is a demonstration of the lockbyproc.d script,
4 dtrace: description 'lockstat:::adaptive-block ' matched 1 probe
8 value ------------- Distribution ------------- count
10 262144 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
14 value ------------- Distribution ------------- count
16 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
20 value ------------- Distribution ------------- count
22 32768 |@@@@@@@@@@@@@@@@@@@ 9
23 65536 |@@@@@@@@@@@@@@@@@@@@@ 10
26 In the above output, oracle can be seen to have blocked 10 times from
27 65 to 131 microseconds, and 9 times from 32 to 65 microseconds. sched,
28 the kernel, has blocked several times also. metadata-manager only
29 blocked once, which was at least 262 microseconds.
33 The following is a longer sample,
36 dtrace: description 'lockstat:::adaptive-block ' matched 1 probe
40 value ------------- Distribution ------------- count
42 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
46 value ------------- Distribution ------------- count
48 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
52 value ------------- Distribution ------------- count
54 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
55 65536 |@@@@@@@@@@@@@ 2
59 value ------------- Distribution ------------- count
61 131072 |@@@@@@@@@@@@@@@@@@@@ 1
62 262144 |@@@@@@@@@@@@@@@@@@@@ 1
66 value ------------- Distribution ------------- count
68 32768 |@@@@@@@@@@@@@ 1
71 262144 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
75 value ------------- Distribution ------------- count
84 value ------------- Distribution ------------- count
87 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@ 25
94 value ------------- Distribution ------------- count
96 32768 |@@@@@@@@@@@@@@@@@@@@@ 22
107 The length of time threads were blocked, and the number of such blocks
108 can be easily observed from the above output.
110 mysqld can be seen to have many short blocks: 22 from 32 -> 65 microseconds,
111 and a few larger blocks: 4 from 8 -> 16 ms.