| 1 |
Examples of fslatency-nd.stp, the Linux SystemTap version. |
| 2 |
|
| 3 |
|
| 4 |
fslatency-nd.stp dynamically traces two common file system functions: |
| 5 |
do_sync_read() and do_sync_write(). Many, but not all, file systems and |
| 6 |
workloads use these functions. Tracing their time provides one view of |
| 7 |
suffered file system latency. |
| 8 |
|
| 9 |
# ./fslatency-nd.stp |
| 10 |
Tracing FS sync reads and writes... Hit Ctrl-C to end. |
| 11 |
^C |
| 12 |
FS latency (ns): |
| 13 |
|
| 14 |
FS call: do_sync_read() |
| 15 |
value |-------------------------------------------------- count |
| 16 |
256 | 0 |
| 17 |
512 | 0 |
| 18 |
1024 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4858 |
| 19 |
2048 |@@@@ 400 |
| 20 |
4096 | 3 |
| 21 |
8192 | 7 |
| 22 |
16384 | 14 |
| 23 |
32768 | 6 |
| 24 |
65536 | 3 |
| 25 |
131072 | 9 |
| 26 |
262144 | 40 |
| 27 |
524288 |@ 164 |
| 28 |
1048576 | 87 |
| 29 |
2097152 | 10 |
| 30 |
4194304 | 5 |
| 31 |
8388608 | 2 |
| 32 |
16777216 | 5 |
| 33 |
33554432 | 16 |
| 34 |
67108864 | 2 |
| 35 |
134217728 | 0 |
| 36 |
268435456 | 1 |
| 37 |
536870912 | 0 |
| 38 |
1073741824 | 0 |
| 39 |
|
| 40 |
FS call: do_sync_write() |
| 41 |
value |-------------------------------------------------- count |
| 42 |
2048 | 0 |
| 43 |
4096 | 0 |
| 44 |
8192 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5335 |
| 45 |
16384 |@@ 260 |
| 46 |
32768 | 32 |
| 47 |
65536 | 2 |
| 48 |
131072 | 2 |
| 49 |
262144 | 0 |
| 50 |
524288 | 0 |
| 51 |
1048576 | 0 |
| 52 |
2097152 | 0 |
| 53 |
4194304 | 1 |
| 54 |
8388608 | 0 |
| 55 |
16777216 | 0 |
| 56 |
|
| 57 |
In the above output, do_sync_read() has multiple modes. The largest, around 1 |
| 58 |
to 4 microseconds, likely corresponds to page cache hits, and spans over 5000 |
| 59 |
reads. Next is a much smaller mode around 0.5 ms, which is likely a disk read. |
| 60 |
Then a small mode around 32 ms, which would likely be disk I/O that queued. |
| 61 |
|
| 62 |
Unlike biolatency-nd.stp, fslatency-nd.stp includes cache hits. |
| 63 |
|
| 64 |
|
| 65 |
Here is a clear bimodal distribution from a random read workload: |
| 66 |
|
| 67 |
# ./fslatency-nd.stp |
| 68 |
Tracing FS sync reads and writes... Hit Ctrl-C to end. |
| 69 |
^C |
| 70 |
FS latency (ns): |
| 71 |
|
| 72 |
FS call: do_sync_read() |
| 73 |
value |-------------------------------------------------- count |
| 74 |
128 | 0 |
| 75 |
256 | 0 |
| 76 |
512 | 2 |
| 77 |
1024 |@ 6 |
| 78 |
2048 |@@@@@@@@@@@ 46 |
| 79 |
4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 134 |
| 80 |
8192 |@@@@@ 20 |
| 81 |
16384 | 2 |
| 82 |
32768 | 1 |
| 83 |
65536 | 0 |
| 84 |
131072 | 0 |
| 85 |
262144 | 1 |
| 86 |
524288 |@@ 9 |
| 87 |
1048576 | 0 |
| 88 |
2097152 |@@@@@@@@@@@@@@ 57 |
| 89 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 200 |
| 90 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 169 |
| 91 |
16777216 |@@@ 13 |
| 92 |
33554432 | 3 |
| 93 |
67108864 | 0 |
| 94 |
134217728 | 0 |
| 95 |
|
| 96 |
The first, around 4 us, is likely page cache hits. The second, around 4-8 ms, |
| 97 |
is likely page cache misses (disk reads). |
| 98 |
|
| 99 |
|
| 100 |
fslatency-nd.ntp takes an optional interval and count as arguments. Eg, to |
| 101 |
show latency every second: |
| 102 |
|
| 103 |
# ./fslatency-nd.stp 1 |
| 104 |
Tracing FS sync reads and writes... Output every 1 secs. |
| 105 |
|
| 106 |
Fri Feb 6 21:58:48 2015 FS latency (ns): |
| 107 |
|
| 108 |
FS call: do_sync_read() |
| 109 |
value |-------------------------------------------------- count |
| 110 |
512 | 0 |
| 111 |
1024 | 0 |
| 112 |
2048 |@@@@@ 11 |
| 113 |
4096 |@@@@@@@@@@@@@ 27 |
| 114 |
8192 |@ 3 |
| 115 |
16384 | 0 |
| 116 |
32768 | 0 |
| 117 |
65536 | 0 |
| 118 |
131072 | 0 |
| 119 |
262144 | 1 |
| 120 |
524288 | 1 |
| 121 |
1048576 | 0 |
| 122 |
2097152 |@@@@ 9 |
| 123 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@ 44 |
| 124 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@ 52 |
| 125 |
16777216 |@@ 4 |
| 126 |
33554432 | 1 |
| 127 |
67108864 | 0 |
| 128 |
134217728 | 0 |
| 129 |
|
| 130 |
|
| 131 |
Fri Feb 6 21:58:49 2015 FS latency (ns): |
| 132 |
|
| 133 |
FS call: do_sync_read() |
| 134 |
value |-------------------------------------------------- count |
| 135 |
512 | 0 |
| 136 |
1024 | 0 |
| 137 |
2048 |@@@@@@@@@ 9 |
| 138 |
4096 |@@@@@@@@@@@@@@@@@@@@@@@@@ 25 |
| 139 |
8192 |@@@@ 4 |
| 140 |
16384 | 0 |
| 141 |
32768 | 0 |
| 142 |
65536 | 0 |
| 143 |
131072 | 0 |
| 144 |
262144 |@ 1 |
| 145 |
524288 |@ 1 |
| 146 |
1048576 |@@ 2 |
| 147 |
2097152 |@@@@@@@@@@@@@@ 14 |
| 148 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 49 |
| 149 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 46 |
| 150 |
16777216 |@@@@@ 5 |
| 151 |
33554432 |@@ 2 |
| 152 |
67108864 | 0 |
| 153 |
134217728 | 0 |
| 154 |
|
| 155 |
|
| 156 |
Fri Feb 6 21:58:50 2015 FS latency (ns): |
| 157 |
|
| 158 |
FS call: do_sync_read() |
| 159 |
value |-------------------------------------------------- count |
| 160 |
512 | 0 |
| 161 |
1024 | 0 |
| 162 |
2048 |@@ 5 |
| 163 |
4096 |@@@@@@@@@@@@@@@@@@@ 38 |
| 164 |
8192 |@@ 4 |
| 165 |
16384 | 0 |
| 166 |
32768 | 0 |
| 167 |
65536 | 0 |
| 168 |
131072 | 0 |
| 169 |
262144 |@ 2 |
| 170 |
524288 | 1 |
| 171 |
1048576 | 0 |
| 172 |
2097152 |@@@@@@@@@@ 21 |
| 173 |
4194304 |@@@@@@@@@@@@@@@@@@@@@ 43 |
| 174 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@ 53 |
| 175 |
16777216 |@ 2 |
| 176 |
33554432 |@ 2 |
| 177 |
67108864 | 0 |
| 178 |
134217728 | 0 |
| 179 |
|
| 180 |
|
| 181 |
Fri Feb 6 21:58:51 2015 FS latency (ns): |
| 182 |
|
| 183 |
FS call: do_sync_read() |
| 184 |
value |-------------------------------------------------- count |
| 185 |
512 | 0 |
| 186 |
1024 | 0 |
| 187 |
2048 |@@@@@@@@ 17 |
| 188 |
4096 |@@@@@@@@@@@@@@@@@@@@@@@@ 49 |
| 189 |
8192 |@ 2 |
| 190 |
16384 | 0 |
| 191 |
32768 | 0 |
| 192 |
65536 | 0 |
| 193 |
131072 | 0 |
| 194 |
262144 |@ 3 |
| 195 |
524288 | 0 |
| 196 |
1048576 | 1 |
| 197 |
2097152 |@@@@@@@@@@@@ 24 |
| 198 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@@@ 48 |
| 199 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@ 52 |
| 200 |
16777216 |@ 3 |
| 201 |
33554432 | 0 |
| 202 |
67108864 | 0 |
| 203 |
|
| 204 |
|
| 205 |
Fri Feb 6 21:58:52 2015 FS latency (ns): |
| 206 |
|
| 207 |
FS call: do_sync_read() |
| 208 |
value |-------------------------------------------------- count |
| 209 |
512 | 0 |
| 210 |
1024 | 0 |
| 211 |
2048 |@@@@@@@@@@@@@ 13 |
| 212 |
4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 34 |
| 213 |
8192 |@@@@@ 5 |
| 214 |
16384 | 0 |
| 215 |
32768 | 0 |
| 216 |
65536 | 0 |
| 217 |
131072 | 0 |
| 218 |
262144 |@ 1 |
| 219 |
524288 |@@@@@@ 6 |
| 220 |
1048576 | 0 |
| 221 |
2097152 |@@@@@@@@@@@@@ 13 |
| 222 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 38 |
| 223 |
8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 46 |
| 224 |
16777216 |@@@@@@@@@@@ 11 |
| 225 |
33554432 | 0 |
| 226 |
67108864 | 0 |
| 227 |
|
| 228 |
|
| 229 |
Fri Feb 6 21:58:53 2015 FS latency (ns): |
| 230 |
|
| 231 |
FS call: do_sync_read() |
| 232 |
value |-------------------------------------------------- count |
| 233 |
512 | 0 |
| 234 |
1024 | 0 |
| 235 |
2048 |@@@@@@@ 15 |
| 236 |
4096 |@@@@@@@@@@@@@@@@@@@@ 41 |
| 237 |
8192 |@@@ 7 |
| 238 |
16384 | 0 |
| 239 |
32768 | 0 |
| 240 |
65536 | 0 |
| 241 |
131072 | 0 |
| 242 |
262144 |@ 2 |
| 243 |
524288 |@ 2 |
| 244 |
1048576 | 0 |
| 245 |
2097152 |@@@@@@@@@@ 21 |
| 246 |
4194304 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 59 |
| 247 |
8388608 |@@@@@@@@@@@@@@@@@@@@@ 42 |
| 248 |
16777216 |@@ 5 |
| 249 |
33554432 | 0 |
| 250 |
67108864 | 0 |