.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH SPEW "1" "May 2010" "spew 1.0.8" "User Commands" .SH NAME spew \- measures I/O performance and/or generates I/O load .SH SYNOPSIS .B spew \fI--write|--read|--read-after-write \fR[\fIOPTION\fR]... \fITRANSFER_SIZE\fR[\fIkKmMgG\fR] \fIFILE\fR .SH DESCRIPTION An I/O performance measurement and load generation tool. Writes and/or reads generated data to or from a character device, block device, or regular file. .TP \fB\-B\fR, \fB\-\-max\-buffer\-size\fR=\fIBUFFER_SIZE\fR Each read(2)/write(2) call uses a maximum buffer of size BUFFER_SIZE. .TP \fB\-b\fR, \fB\-\-min\-buffer\-size\fR=\fIBUFFER_SIZE\fR Each read(2)/write(2) call uses a minimum buffer of size BUFFER_SIZE. .TP \fB\-c\fR, \fB\-\-continue\-after\-error\fR Continue after data integrity errors. .TP \fB\-d\fR, \fB\-\-direct\fR Use direct I/O. Should only be used on block device files. Not all operating systems support direct I/O .TP \fB\-g\fR, \fB\-\-generate\-load\fR Equivalent to: \fB\-v\fR \fB\-t\fR \fB\-P\fR \fB\-p\fR random \fB\-i\fR 0. .TP \fB\-i\fR, \fB\-\-iterations\fR=\fICOUNT\fR Write/read data COUNT times. If count is 0, repeats forever. .TP \fB\-l\fR, \fB\-\-logfile\fR=\fILOGFILE\fR Send log messages to LOGFILE. .TP \fB\-\-no\-progress\fR Don't show progress (default). .TP \fB\-\-no\-rcfiles\fR Don't use standard rcfiles. .TP \fB\-q\fR, \fB\-\-no\-statistics\fR Don't output statistics. .TP \fB\-\-no\-tui\fR Don't use TUI interface. .TP \fB\-o\fR, \fB\-\-offset\fR=\fIOFFSET\fR Seek to OFFSET before starting I/O. .TP \fB\-P\fR, \fB\-\-progress\fR Show progress. .TP \fB\-p\fR, \fB\-\-pattern\fR=\fIPATTERN\fR Use data pattern PATTERN when reading or writing data. .TP \fB\-r\fR, \fB\-\-random\fR Read/Write buffers to random offsets. .TP \fB\-\-raw\fR An alias for \fB\-\-read\-after\-write\fR. .TP \fB\-\-rcfile\fR=\fIRCFILE\fR Read command\-line options from RCFILE. .TP \fB\-\-read\fR Read date from FILE. .TP \fB\-\-read\-after\-write\fR Read back data after writing to FILE. .TP \fB\-S\fR, \fB\-\-seed\fR=\fISEED\fR Use SEED for random number seed. .TP \fB\-s\fR, \fB\-\-sync\fR Use synchronous I/O. .TP \fB\-\-statistics\fR Output statistics (default). .TP \fB\-t\fR, \fB\-\-tui\fR Use curses\-based, terminal user interface. .TP \fB\-u\fR, \fB\-\-units\fR=\fIUNITS\fR Show transfer rate in UNITS units. .TP \fB\-\-usage\fR Show brief usage message and exit. .TP \fB\-V\fR, \fB\-\-version\fR Output version information and exit. .TP \fB\-v\fR, \fB\-\-detailed\-statistics\fR Output detailed statistics. .TP \fB\-\-write\fR Write data to FILE. .TP \-?, \fB\-\-help\fR Show this help and exit. .TP FILE Regular or device file to write data to. .TP LOGFILE Path to a file used for logging. .TP MAX_BUFFER_SIZE Minimum buffer size used in each read(2)/write(2) call (default is MIN_BUFFER_SIZE bytes). MAX_BUFFER_SIZE. Must be an even multiple of 512 bytes and can be specified in bytes, kibibytes(k), kilobytes(K), mebibytes(m), megabytes(M), gibibytes(g), gigabytes(G). tebibytes(t), or terabytes(T). MAX_BUFFER_SIZE defaults to MIN_BUFFER_SIZE. If MAX_BUFFER_SIZE > MIN_BUFFER_SIZE, random buffers sizes between the two limits are used. MAX_BUFFER_SIZE must be an even multiple of MIN_BUFFER_SIZE. .TP MIN_BUFFER_SIZE Minimum buffer size used in each read(2)/write(2) call (default is 512 bytes). MIN_BUFFER_SIZE. Must be an even multiple of 512 bytes and can be specified in bytes, kibibytes(k), kilobytes(K), mebibytes(m), megabytes(M), gibibytes(g), gigabytes(G). tebibytes(t), or terabytes(T). .TP OFFSET Position to seek to in the file before starting I/O (default is 0). OFFSET must be an even multiple of 512 bytes and can be specified in bytes, kibibytes(k), kilobytes(K), mebibytes(m), megabytes(M), gibibytes(g), gigabytes(G). tebibytes(t), or terabytes(T). .TP PATTERN Data pattern used when writing/reading data. Available patterns are: none, zeros, ones, alt, random, numbers, and "#" (where "#" is a number between 0\-255). The default pattern is "none". .TP RCFILE Read additional command\-line options from RCFILE. Other options on the command\-line will override options in RCFILE. .TP SEED Used to seed the random number generator Must be >= 1 and <= 2^32. .TP TRANSFER_SIZE Total number of bytes to transfer (must be an even multiple of both MIN_BUFFER_SIZE and MAX_BUFFER)SIZE). TRANSFER_SIZE can be specified in bytes, kilobytes, megabytes, or gigabytes. .TP UNITS Kibibytes(k), kilobytes(K), mebibytes(m), megabytes(M), gibibytes(g), gigabytes(G). tebibytes(t), or terabytes(T). .SH EXAMPLES \fBspew --write -b 16k 1m /tmp/bigfile\fR .PP or .PP \fBspew -b 16k 1m /tmp/bigfile\fR .PP Writes 1 mebibyte (1 mebibyte = 1024*1024 bytes) using 16 kibibytes (1 kibibyte = 1024 bytes) requests to the file \fI/tmp/bigfile\fR using the default pattern (random). . Displays the write transfer rate in kibibytes per second and the write transfer time in seconds. . .PP \fBspew --write -u m -i 10 -b 1k 256k /dev/sda1\fR .PP or .PP \fBspew -u m -i 10 -b 1k 256k /dev/sda1\fR .PP Writes 256 kibibytes using 1 kibibyte requests to the block device file \fI/dev/sda1\fR 10 times using the default pattern (random). . The iteration and cumulative write transfer rates are displayed in mebibytes per second and the iteration and cumulative write transfer times are displayed in seconds. .PP \fBspew --raw -d -o 1m -b 16m 1g /tmp/bigfile\fR .PP or .PP \fBregorge -s -o 1m -b 16m 1g /tmp/bigfile\fR .PP Write 1 gibibyte (1 gibibyte = 1024*1024*1024 bytes) starting at an offset of 1 mebibyte using 16 mebibyte requests to the file \fI/tmp/bigfile\fR using the default pattern (random). . The data is written synchronously and flushed at file close. . Then read in the same data using the same request size and offset. . The data is checked to ensure that the data read in matches the data read out. . Write and read transfer rates are displayed in kibibytes/second. Read and write transfer times are displayed in seconds. .PP \fBspew --read -i 0 -u M -p zeros -b 512 1m /dev/zero\fR .PP or .PP \fBgorge -i 0 -u M -p zeros -b 512 1m /dev/zero\fR .PP Read 1 mebibyte of data using 512 byte requests from the file \fI/dev/zero\fR an infinite number of times using the zeros pattern (don't check the data). . The iteration and cumulative read transfer rates are displayed in megabytes (1 megabyte = 1,000,000 bytes) per second and the iteration and cumulative read transfer times are displayed in seconds. .PP \fBspew --raw -g -r -b 1k -B 256K 1t /dev/md1\fR .PP or .PP \fBregorge -g -r -b 1k -B 256K 1t /dev/md1\fR .PP Write 1 tebibyte (1 tebibyte = 1024*1024*1024*1024 bytes) using 1-256 kibibyte requests to the block device \fI/dev/md1\fR using the random pattern. Random seeks are performed before each transfer, but each block between the start and end of the data is written exactly once. . The request sizes are chosen randomly. . Then read in the same data using the same request sizes and seeks in the same sequence. . Repeat the above sequence an infinite number of times until told to quit (via signal or TUI command). .PP The data is checked to ensure that the data read in matches the data read out. . A curses-based TUI is used to display iteration and cumulative transfer rates, transfer times, and bytes transferred. . Display verbose statistics after quitting. . .SH ALGORITHMS . The following algorithm is used to determine blocksize when MAX_BUFFER_SIZE > MIN_BUFFER_SIZE: .PP Find the largest blocksize that is a power of 2 and is >= MAX_BUFFER_SIZE. . Call this maxbuffersize. Find the smallest buffersize that is a power of 2 and is >= MIN_BUFFER_SIZE. Call this minbuffersize. . Chunksize = maxbuffersize * (difference in number of bits between min and maxbuffersize + 1). . The number of chunks is TRANSFER_SIZE/chunksize. Call this numchunks. . There will be numchunks number of read/writes that are of size maxbuffersize, 2 * numchunks number of read/writes that are of size maxbuffersize/2, 4 * numchunks number of read/writes that are of size maxbuffersize/4, and so on until minbuffersize is reached. . MIN_BUFFER_SIZE is used for any remaining transfers if TRANSFER_SIZE is not evenly divisible by chunksize. .PP Example: Using a MIN_BLOCK_SIZE of 1k, a MAX_BLOCK_SIZE of 8k and a TRANSFER_SIZE of 264k results in 8 8k read/writes, 16 4k read/write, 32 2k read/writes, and 64 + 8 1k read/writes. .SH PATTERNS . Use the following od(1) command to examine spew generated files where a data integrity problem has occurred: .PP od -A d --format=d8 --width=32 .PP .SH FILES .TP \fl$HOME/.spewrc\fR or \fl$SPEWRC\fR Holds user default options. These options precede any options included on the command-line. .TP \fl/etc/spew.conf\fR Holds system-wide default options. These options precede any options included on the command-line and options included from \fl$HOME/.spewrc\fR or \fl$SPEWRC\fR. .SH AUTHOR Written by Andrew Patterson .SH "REPORTING BUGS" Report bugs to Andrew Patterson . .PP Copyright 2007 Hewlett\-Packard Corp.