1SPEW(1)                          User Commands                         SPEW(1)
2
3
4

NAME

6       spew - measures I/O performance and/or generates I/O load
7

SYNOPSIS

9       spew  --write|--read|--read-after-write  [OPTION]... TRANSFER_SIZE[kKm‐
10       MgG] FILE
11

DESCRIPTION

13       An I/O performance measurement and load generation tool. Writes  and/or
14       reads  generated  data  to or from a character device, block device, or
15       regular file.
16
17       -B, --max-buffer-size=BUFFER_SIZE
18              Each read(2)/write(2) call uses a maximum buffer  of  size  BUF‐
19              FER_SIZE.
20
21       -b, --min-buffer-size=BUFFER_SIZE
22              Each  read(2)/write(2)  call  uses a minimum buffer of size BUF‐
23              FER_SIZE.
24
25       -c, --continue-after-error
26              Continue after data integrity errors.
27
28       -d, --direct
29              Use direct I/O. Should only be used on block device  files.  Not
30              all operating systems support direct I/O
31
32       -g, --generate-load
33              Equivalent to: -v -t -P -p random -i 0.
34
35       -i, --iterations=COUNT
36              Write/read data COUNT times. If count is 0, repeats forever.
37
38       -l, --logfile=LOGFILE
39              Send log messages to LOGFILE.
40
41       --no-progress
42              Don't show progress (default).
43
44       --no-rcfiles
45              Don't use standard rcfiles.
46
47       -q, --no-statistics
48              Don't output statistics.
49
50       --no-tui
51              Don't use TUI interface.
52
53       -o, --offset=OFFSET
54              Seek to OFFSET before starting I/O.
55
56       -P, --progress
57              Show progress.
58
59       -p, --pattern=PATTERN
60              Use data pattern PATTERN when reading or writing data.
61
62       -r, --random
63              Read/Write buffers to random offsets.
64
65       --raw  An alias for --read-after-write.
66
67       --rcfile=RCFILE
68              Read command-line options from RCFILE.
69
70       --read Read date from FILE.
71
72       --read-after-write
73              Read back data after writing to FILE.
74
75       -S, --seed=SEED
76              Use SEED for random number seed.
77
78       -s, --sync
79              Use synchronous I/O.
80
81       --statistics
82              Output statistics (default).
83
84       -t, --tui
85              Use curses-based, terminal user interface.
86
87       -u, --units=UNITS
88              Show transfer rate in UNITS units.
89
90       --usage
91              Show brief usage message and exit.
92
93       -V, --version
94              Output version information and exit.
95
96       -v, --detailed-statistics
97              Output detailed statistics.
98
99       --write
100              Write data to FILE.
101
102       -?, --help
103              Show this help and exit.
104
105       FILE   Regular or device file to write data to.
106
107       LOGFILE
108              Path to a file used for logging.
109
110       MAX_BUFFER_SIZE
111              Minimum  buffer size used in each read(2)/write(2) call (default
112              is MIN_BUFFER_SIZE bytes).  MAX_BUFFER_SIZE.  Must  be  an  even
113              multiple   of   512   bytes  and  can  be  specified  in  bytes,
114              kibibytes(k),    kilobytes(K),    mebibytes(m),    megabytes(M),
115              gibibytes(g),   gigabytes(G).   tebibytes(t),  or  terabytes(T).
116              MAX_BUFFER_SIZE defaults to MIN_BUFFER_SIZE.  If MAX_BUFFER_SIZE
117              >  MIN_BUFFER_SIZE,  random buffers sizes between the two limits
118              are used.  MAX_BUFFER_SIZE must be an even multiple of  MIN_BUF‐
119              FER_SIZE.
120
121       MIN_BUFFER_SIZE
122              Minimum  buffer size used in each read(2)/write(2) call (default
123              is 512 bytes).  MIN_BUFFER_SIZE. Must be an even multiple of 512
124              bytes and can be specified in bytes, kibibytes(k), kilobytes(K),
125              mebibytes(m),    megabytes(M),    gibibytes(g),    gigabytes(G).
126              tebibytes(t), or terabytes(T).
127
128       OFFSET Position  to seek to in the file before starting I/O (default is
129              0). OFFSET must be an even multiple of  512  bytes  and  can  be
130              specified  in  bytes,  kibibytes(k), kilobytes(K), mebibytes(m),
131              megabytes(M), gibibytes(g), gigabytes(G).  tebibytes(t), or ter‐
132              abytes(T).
133
134       PATTERN
135              Data  pattern used when writing/reading data. Available patterns
136              are: none, zeros, ones, alt, random, numbers, and "#" (where "#"
137              is a number between 0-255). The default pattern is "none".
138
139       RCFILE Read additional command-line options from RCFILE.  Other options
140              on the command-line will override options in RCFILE.
141
142       SEED   Used to seed the random number generator Must be  >=  1  and  <=
143              2^32.
144
145       TRANSFER_SIZE
146              Total  number  of bytes to transfer (must be an even multiple of
147              both MIN_BUFFER_SIZE and MAX_BUFFER)SIZE).  TRANSFER_SIZE can be
148              specified in bytes, kilobytes, megabytes, or gigabytes.
149
150       UNITS  Kibibytes(k),    kilobytes(K),    mebibytes(m),    megabytes(M),
151              gibibytes(g), gigabytes(G).  tebibytes(t), or terabytes(T).
152

EXAMPLES

154       spew --write -b 16k 1m /tmp/bigfile
155
156       or
157
158       spew -b 16k 1m /tmp/bigfile
159
160       Writes 1 mebibyte (1 mebibyte = 1024*1024 bytes) using 16 kibibytes  (1
161       kibibyte  =  1024  bytes)  requests  to the file /tmp/bigfile using the
162       default  pattern  (random).   Displays  the  write  transfer  rate   in
163       kibibytes per second and the write transfer time in seconds.
164
165       spew --write -u m -i 10 -b 1k 256k /dev/sda1
166
167       or
168
169       spew -u m -i 10 -b 1k 256k /dev/sda1
170
171       Writes 256 kibibytes using 1 kibibyte requests to the block device file
172       /dev/sda1 10 times using the default pattern (random).   The  iteration
173       and cumulative write transfer rates are displayed in mebibytes per sec‐
174       ond and the iteration and cumulative write transfer times are displayed
175       in seconds.
176
177       spew --raw -d -o 1m -b 16m 1g /tmp/bigfile
178
179       or
180
181       regorge -s -o 1m -b 16m 1g /tmp/bigfile
182
183       Write  1  gibibyte  (1  gibibyte = 1024*1024*1024 bytes) starting at an
184       offset of 1 mebibyte using 16 mebibyte requests to the  file  /tmp/big‐
185       file  using  the  default  pattern  (random).  The data is written syn‐
186       chronously and flushed at file close.  Then read in the same data using
187       the  same  request size and offset.  The data is checked to ensure that
188       the data read in matches the data read out.   Write  and  read  tranfer
189       rates are displayed in kibibytes/second.  Read are write transfer times
190       are displayed in seconds.
191
192       spew --read -i 0 -u M -p zeros -b 512 1m /dev/zero
193
194       or
195
196       gorge -i 0 -u M -p zeros -b 512 1m /dev/zero
197
198       Read 1 mebibyte of data using 512 byte requests from the file /dev/zero
199       an  infinite  number  of times using the zeros pattern (don't check the
200       data).  The iteration and cumulative read transfer rates are  displayed
201       in  megabytes  (1 megabyte = 1,000,000 bytes) per second and the itera‐
202       tion and cumulative read transfer times are displayed in seconds.
203
204       spew --raw -g -r -b 1k -B 256K 1t /dev/md1
205
206       or
207
208       regorge -g -r -b 1k -B 256K 1t /dev/md1
209
210       Write 1 tebibyte (1 tebibyte = 1024*1024*1024*1024 bytes)  using  1-256
211       kibibyte  requests  to  the block device /dev/md1 using the random pat‐
212       tern.  Random seeks are performed before each transfer, but each  block
213       between  the  start  and  end of the data is written exactly once.  The
214       request sizes are chosen randomly.  Then read in the  same  data  using
215       the  same  request  sizes  and  seeks in the same sequence.  Repeat the
216       above sequence an infinite number of times until told to quit (via sig‐
217       nal or TUI command).
218
219       The  data  is  checked to ensure that the data read in matches the data
220       read out.  A curses-based TUI is used to display iteration and  cumula‐
221       tive  transfer  rates,  transfer times, and bytes transferred.  Display
222       verbose statistics after quitting.
223

ALGORITHMS

225       The following algorithm is used to determine  blocksize  when  MAX_BUF‐
226       FER_SIZE > MIN_BUFFER_SIZE:
227
228       Find  the  largest  blocksize  that  is a power of 2 and is >= MAX_BUF‐
229       FER_SIZE.  Call this maxbuffersize. Find the smallest  buffersize  that
230       is  a  power  of  2 and is >= MIN_BUFFER_SIZE. Call this minbuffersize.
231       Chunksize = maxbuffersize * (difference in number of bits  between  min
232       and  maxbuffersize  + 1).  The number of chunks is TRANSFER_SIZE/chunk‐
233       size.  Call  this  numchunks.   There  will  be  numchunks  number   of
234       read/writes  that  are  of  size maxbuffersize, 2 * numchunks number of
235       read/writes that are of size maxbuffersize/2, 4 * numchunks  number  of
236       read/writes  that  are  of  size  maxbuffersize/4, and so on until min‐
237       buffersize is reached.   MIN_BUFFER_SIZE  is  used  for  any  remaining
238       transfers if TRANSFER_SIZE is not evenly divisible by chunksize.
239
240       Example:  Using  a  MIN_BLOCK_SIZE  of 1k, a MAX_BLOCK_SIZE of 8k and a
241       TRANSFER_SIZE of 264k results in 8 8k read/writes, 16 4k read/write, 32
242       2k read/writes, and 64 + 8 1k read/writes.
243

PATTERNS

245       Use the following od(1) command to examine spew generated files where a
246       data integrity problem has occurred:
247
248       od -A d --format=d8 --width=32  <file>
249

FILES

251       $HOME/.spewrc or $SPEWRC
252              Holds user default options. These options  precede  any  options
253              included on the command-line.
254
255       /etc/spew.conf
256              Holds  system-wide  default  options.  These options precede any
257              options included on the command-line  and options included  from
258              $HOME/.spewrc or $SPEWRC.
259

AUTHOR

261       Written by Andrew Patterson <andrew.patterson@hp.com>
262

REPORTING BUGS

264       Report bugs to Andrew Patterson <andrew.patterson@hp.com>.
265
266       Copyright 2007 Hewlett-Packard Corp.
267
268
269
270spew 1.0.8                         May 2010                            SPEW(1)
Impressum