SRAW(8)

πŸ’… SRAW β€” the raw SCSI I/O benchmark, bestie edition

okay so first things first: this is sraw(8), a System Manager's Manual page, and it's about benchmarking raw SCSI I/O performance under Linux. yes it's from Nov 1993 and yes it still eats. let's get into it 🫢


✨ NAME ✨

sraw β€” benchmark raw scsi I/O performance under linux


🌸 SYNOPSIS 🌸

sraw [ -fiv6 ] scsi-device [ bstart [ bstep ] ]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so basically this program reads the scsi device you point it at and measures the throughput. that's the whole vibe. and listen β€” the filesystem AND the buffer cache are bypassed by this code, like completely ghosted. this program was literally designed to benchmark the naked scsi drivers by themselves, without having to account for the overhead of any other portion of the kernel. lowkey iconic. it also could be used to benchmark disk read throughput, which, sure, bonus.

here's the flow: the program does a series of reads of the disk, over consecutive areas on the disk. first it queries the device to figure out the sector size for that device, and then the series of reads begins. about 5.0 Mb gets read from the device, and then the performance numbers are reported. and because the buffer cache is completely bypassed, you do not have to be concerned about cache hits or anything like that. no thoughts, no cache, head empty, just raw reads πŸ’€

the output of sraw is a set of lines, 4 numbers per line: blocksize, elapsed time, nblocks and throughput (in bytes per second). slay.

scsi-device is either a block device (e.g. /dev/sda, /dev/scd0) or a generic SCSI device (e.g. /dev/sg0).


πŸ‘‘ OPTIONS πŸ‘‘

  • -f β€” set the FUA (Force Unit Access) bit during read. so the data is then read from media instead of the internal drive cache. no shortcuts, no lies, we go straight to the source ✨
  • -i β€” use the legacy ioctl instead of the new SG I/O layer. heads up bestie, this will not work on 2.6 kernel and block devices. it's giving retro, it's giving deprecated-ish, know what you're doing πŸ’€
  • -v β€” more verbose output. give me all the lore πŸ—£οΈ
  • -6 β€” use a 6-bytes read command instead of a 10-bytes read command. in this case, only the first 1 GB of data could be read from media. so like, a limited edition read. plan accordingly.
  • bstart β€” starting block, for checking different zones on ZBR discs.
  • bstep β€” factor for sequential stepping, default 1. use 0 for reading always the same blocks (from cache).

😭 ERRORS 😭

sraw could issue input/output errors when reading too many blocks at the same time from a block device like /dev/sda. to get rid of them, use /dev/sgN instead.

like, that's it, that's the fix. the block device is being dramatic, the generic SCSI device is not. switch and thrive 🧚


πŸŽ€ AUTHOR πŸŽ€

sraw was first written by Eric Youngdale. the extensions (-v, -f, -6, SG IO, man page) were written by Eric Delaunay. two Erics, one legend. we stan 🌈


πŸ”₯ SEE ALSO πŸ”₯


πŸ’œ AVAILABILITY πŸ’œ

sraw is available at:

ftp://tsx-11.mit.edu/pub/linux/ALPHA/scsi/

okay that's the whole page, you're fully caught up, go benchmark something responsibly ✨

this little number comes from the System Manager's Manual, dated Nov 1993 β€” vintage but make it feral πŸ’…

πŸ“¦ where this page comes from