Skip to content

Instantly share code, notes, and snippets.

@vietdien2005
Last active May 29, 2020 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vietdien2005/770040dc098a1a382220a3841fe826b4 to your computer and use it in GitHub Desktop.
Save vietdien2005/770040dc098a1a382220a3841fe826b4 to your computer and use it in GitHub Desktop.
Check Performance Disk

Commands Check Performance Disk

Commands

  • Reading speed cache/buffer: hdparm
  • Check cache reading speed: hdparm
  • Sequential write speed: dd
  • Check iops when random read/write (block 4K): fio

Usage hdparm

  • Command: hdparm -tT /dev/sdb
  • Output:
/dev/sdb:
 Timing cached reads:   12706 MB in  2.00 seconds = 6357.09 MB/sec
 Timing buffered disk reads: 346 MB in  3.00 seconds = 115.31 MB/sec
  • Explain
-t: Perform device read timings
-T: Perform cache read timings

Usage dd

  • Command dd if=/dev/sdb of=2GB.bin bs=2G count=1 oflag=dsync
  • Output:
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB, 2.0 GiB) copied, 63.3605 s, 33.9 MB/s
  • Explain:
of=2GB.bin: output file
bs=2GB: block size
count: number of block
oflag=dsync: use synchronized I/O for data

Usage fio

  • Command fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment