1TAPESTAT(1) Linux User's Manual TAPESTAT(1)
2
3
4
6 tapestat - Report tape statistics.
7
9 tapestat [ -k | -m ] [ -t ] [ -V ] [ -y ] [ -z ] [ interval [ count ] ]
10
12 The tapestat command is used for monitoring the activity of tape drives
13 connected to a system.
14
15 The first report generated by the tapestat command provides statistics
16 concerning the time since the system was booted, unless the -y option
17 is used, when this first report is omitted. Each subsequent report
18 covers the time since the previous report.
19
20 The interval parameter specifies the amount of time in seconds between
21 each report. The count parameter can be specified in conjunction with
22 the interval parameter. If the count parameter is specified, the value
23 of count determines the number of reports generated at interval seconds
24 apart. If the interval parameter is specified without the count parame‐
25 ter, the tapestat command generates reports continuously.
26
27
29 The tapestat report provides statistics for each tape drive connected
30 to the system. The following data are displayed:
31
32 r/s
33 The number of reads issued expressed as the number per second
34 averaged over the interval.
35
36 w/s
37 The number of writes issued expressed as the number per second
38 averaged over the interval.
39
40 kB_read/s | MB_read/s
41 The amount of data read expressed in kilobytes (by default or if
42 option -k used) or megabytes (if option -m used) per second
43 averaged over the interval.
44
45 kB_wrtn/s | MB_wrtn/s
46 The amount of data written expressed in kilobytes (by default or
47 if option -k used) or megabytes (if option -m used) per second
48 averaged over the interval.
49
50 %Rd
51 Read percentage wait - The percentage of time over the interval
52 spent waiting for read requests to complete. The time is mea‐
53 sured from when the request is dispatched to the SCSI mid-layer
54 until it signals that it completed.
55
56 %Wr
57 Write percentage wait - The percentage of time over the interval
58 spent waiting for write requests to complete. The time is mea‐
59 sured from when the request is dispatched to the SCSI mid-layer
60 until it signals that it completed.
61
62 %Oa
63 Overall percentage wait - The percentage of time over the inter‐
64 val spent waiting for any I/O request to complete (read, write,
65 and other).
66
67 Rs/s
68 The number of I/Os, expressed as the number per second averaged
69 over the interval, where a non-zero residual value was encoun‐
70 tered.
71
72 Ot/s
73 The number of I/Os, expressed as the number per second averaged
74 over the interval, that were included as "other". Other I/O
75 includes ioctl calls made to the tape driver and implicit opera‐
76 tions performed by the tape driver such as rewind on close (for
77 tape devices that implement rewind on close). It does not
78 include any I/O performed using methods outside of the tape
79 driver (e.g. via sg ioctls).
80
82 -k Show the amount of data written or read in kilobytes per second
83 instead of megabytes. This option is mutually exclusive with
84 -m.
85
86 -m Show the amount of data written or read in megabytes per second
87 instead of kilobytes. This option is mutually exclusive with
88 -k.
89
90 -t Display time stamps. The time stamp format may depend on the
91 value of the S_TIME_FORMAT environment variable (see below).
92
93 -V Print version and exit.
94
95 -y Omit the initial statistic showing values since boot.
96
97 -z Tell tapestat to omit output for any tapes for which there was
98 no activity during the sample period.
99
100
102 It is possible for a percentage value (read, write, or other) to be
103 greater than 100 percent (the tapestat command will never show a per‐
104 centage value more than 999). If rewinding a tape takes 40 seconds
105 where the interval time is 5 seconds the %Oa value would show as 0 in
106 the intervals before the rewind completed and then show as approxi‐
107 mately 800 percent when the rewind completes.
108
109 Similar values will be observed for %Rd and %Wr if a tape drive stops
110 reading or writing and then restarts (that is it stopped streaming). In
111 such a case you may see the r/s or w/s drop to zero and the %Rd/%Wr
112 value could be higher than 100 when reading or writing continues
113 (depending on how long it takes to restart writing or reading). This
114 is only an issue if it happens a lot as it may cause tape wear and will
115 impact on the backup times.
116
117 For fast tape drives you may see low percentage wait times. This does
118 not indicate an issue with the tape drive. For a slower tape drive
119 (e.g. an older generation DDS drive) the speed of the tape (and tape
120 drive) is much slower than filesystem I/O, percent wait times are
121 likely to be higher. For faster tape drives (e.g. LTO) the percentage
122 wait times are likely to be lower as program writing to or reading from
123 tape is going to be doing a lot more filesystem I/O because of the
124 higher throughput.
125
126 Although tape statistics are implemented in the kernel using atomic
127 variables they cannot be read atomically as a group. All of the statis‐
128 tics values are read from different files under /sys, because of this
129 there may be I/O completions while reading the different files for the
130 one tape drive. This may result in a set of statistics for a device
131 that contain some values before an I/O completed and some after.
132
133 This command uses rounding down as the rounding method when calculating
134 per second statistics. If, for example, you are using dd to copy one
135 tape to another and running tapestat with an interval of 5 seconds and
136 over the interval there were 3210 writes and 3209 reads then w/s would
137 show 642 and r/s 641 (641.8 rounded down to 641). In such a case if it
138 was a tar archive being copied (with a 10k block size) you would also
139 see a difference between the kB_read/s and kB_wrtn/s of 2 (one I/O 10k
140 in size divided by the interval period of 5 seconds). If instead there
141 were 3210 writes and 3211 reads both w/s and r/s would both show 642
142 but you would still see a difference between the kB_read/s and
143 kB_wrtn/s values of 2 kB/s.
144
145 This command is provided with an interval in seconds. However inter‐
146 nally the interval is tracked per device and can potentially have an
147 effect on the per second statistics reported. The time each set of
148 statistics is captured is kept with those statistics. The difference
149 between the current and previous time is converted to milliseconds for
150 use in calculations. We can look at how this can impact the statistics
151 reported if we use an example of a tar archive being copied between two
152 tape drives using dd. If both devices reported 28900 kilobytes trans‐
153 ferred and the reading tape drive had an interval of 5001 milliseconds
154 and the writing tape drive 5000 milliseconds that would calculate out
155 as 5778 kB_read/s and 5780 kB_wrtn/s.
156
157 The impact of some retrieving statistics during an I/O completion,
158 rounding down, and small differences in the interval period on the sta‐
159 tistics calculated should be minimal but may be non-zero.
160
162 The tapestat command takes into account the following environment vari‐
163 able:
164
165
166 S_TIME_FORMAT
167 If this variable exists and its value is ISO then the current
168 locale will be ignored when printing the date in the report
169 header. The tapestat command will use the ISO 8601 format (YYYY-
170 MM-DD) instead. The timestamp displayed with option -t will
171 also be compliant with ISO 8601 format.
172
173
175 /sys filesystem must be mounted for tapestat to work. It will not work
176 on kernels that do not have sysfs support
177
178 This command requires kernel version 4.2 or later (or tape statistics
179 support backported for an earlier kernel version).
180
181
183 /sys/class/scsi_tape/st<num>/stats/* Statistics files for tape devices.
184
185 /proc/uptime contains system uptime.
186
188 Initial revision by Shane M. SEYMOUR (shane.seymour <at> hpe.com)
189 Modified for sysstat by Sebastien Godard (sysstat <at> orange.fr)
190
192 iostat(1), mpstat(1)
193
194 http://pagesperso-orange.fr/sebastien.godard/
195
196
197
198Linux MARCH 2016 TAPESTAT(1)