Skip to content

Instantly share code, notes, and snippets.

@noslin005
Forked from t-okkn/fio-CrystalDiskMark.md
Created January 26, 2022 20:51
Show Gist options
  • Save noslin005/2adbd5284b8fa8cb970adb4df4e565a0 to your computer and use it in GitHub Desktop.
Save noslin005/2adbd5284b8fa8cb970adb4df4e565a0 to your computer and use it in GitHub Desktop.

Linuxでfioを使用して簡易ディスクベンチマーク!

LinuxでもCrystalDiskMarkぽいディスクベンチマークしたい】に触発されてCrystalDiskMarkの各バージョンのデフォルト値でのベンチマークパラメータをfioで再現してみました。 是非お使いください。

使い方

コマンド一例:

$ curl -sS https://gist.githubusercontent.com/t-okkn/c805b95dde1c6b9a528d1e3095814ebd/raw/a2b19eee9415fafd47285b53d0a5ae73b338fe6e/fio-CrystalDiskMark_old.txt | tee ~/fio.txt

$ # 一覧で表示
$ FIO_TARGET=~/fio fio -f fio.txt --output-format=terse | awk -F ';' '{ speed = (($7+$48) * 1024) / 1000; unit = "KB/s"; if (speed >= 1000000) { speed = (speed / 1000000); unit = "GB/s" } else if (speed >= 1000) { speed = (speed / 1000); unit = "MB/s" }; printf "%-22s %.3f %s\n", $3, speed, unit }'

$ # 表で表示
$ FIO_TARGET=~/fio fio -f fio.txt --output-format=terse | awk -F ';' '{ speed = (($7+$48) * 1024) / 1000; unit = "KB/s"; if (speed >= 1000000) { speed = (speed / 1000000); unit = "GB/s" } else if (speed >= 1000) { speed = (speed / 1000); unit = "MB/s" }; printf "%s %.3f %s\n", $3, speed, unit }' | awk -F '[- ]' '{ if (NR % 2 == 1) printf "%s-%s %s %s ", $1, $2, $4, $5; else print $4, $5 }' | awk 'BEGIN{ print "|   Test Name    |     Read     |    Write     |"; print "|----------------|--------------|--------------|"}; { printf "| %14s | %7s %s | %7s %s |\n", $1, $2, $3, $4, $5 }'

結果例:
SEQ1M-Q1T1-Read        1.407 GB/s
SEQ1M-Q1T1-Write       853.889 MB/s
RND512K-Q1T1-Read      170.555 MB/s
RND512K-Q1T1-Write     780.771 MB/s
RND4K-Q1T1-Read        33.997 MB/s
RND4K-Q1T1-Write       128.391 MB/s
RND4K-Q32T1-Read       381.023 MB/s
RND4K-Q32T1-Write      277.915 MB/s
Test Name Read Write
SEQ1M-Q1T1 1.327 GB/s 801.299 MB/s
RND512K-Q1T1 173.380 MB/s 767.506 MB/s
RND4K-Q1T1 35.158 MB/s 133.966 MB/s
RND4K-Q32T1 341.737 MB/s 613.917 MB/s
[global]
ioengine=libaio
iodepth=1
numjobs=1
size=1g
direct=1
runtime=60
directory=${FIO_TARGET}
stonewall
[SEQ1M-Q1T1-Read]
bs=1m
rw=read
[SEQ1M-Q1T1-Write]
bs=1m
rw=write
[RND512K-Q1T1-Read]
bs=512k
rw=randread
[RND512K-Q1T1-Write]
bs=512k
rw=randwrite
[RND4K-Q1T1-Read]
bs=4k
rw=randread
[RND4K-Q1T1-Write]
bs=4k
rw=randwrite
[RND4K-Q32T1-Read]
bs=4k
iodepth=32
rw=randread
[RND4K-Q32T1-Write]
bs=4k
iodepth=32
rw=randwrite
[global]
ioengine=libaio
iodepth=1
numjobs=1
size=1g
direct=1
runtime=60
directory=${FIO_TARGET}
stonewall
[SEQ1M-Q32T1-Read]
bs=1m
iodepth=32
rw=read
[SEQ1M-Q32T1-Write]
bs=1m
iodepth=32
rw=write
[RND4K-Q32T1-Read]
bs=4k
iodepth=32
rw=randread
[RND4K-Q32T1-Write]
bs=4k
iodepth=32
rw=randwrite
[SEQ1M-Q1T1-Read]
bs=1m
rw=read
[SEQ1M-Q1T1-Write]
bs=1m
rw=write
[RND4K-Q1T1-Read]
bs=4k
rw=randread
[RND4K-Q1T1-Write]
bs=4k
rw=randwrite
[global]
ioengine=libaio
iodepth=1
numjobs=1
size=1g
direct=1
runtime=60
directory=${FIO_TARGET}
stonewall
[SEQ1M-Q32T1-Read]
bs=1m
iodepth=32
rw=read
[SEQ1M-Q32T1-Write]
bs=1m
iodepth=32
rw=write
[RND4K-Q8T8-Read]
bs=4k
iodepth=8
numjobs=8
rw=randread
group_reporting
[RND4K-Q8T8-Write]
bs=4k
iodepth=8
numjobs=8
rw=randwrite
group_reporting
[RND4K-Q32T1-Read]
bs=4k
iodepth=32
rw=randread
[RND4K-Q32T1-Write]
bs=4k
iodepth=32
rw=randwrite
[RND4K-Q1T1-Read]
bs=4k
rw=randread
[RND4K-Q1T1-Write]
bs=4k
rw=randwrite
[global]
ioengine=libaio
iodepth=1
numjobs=1
size=1g
direct=1
runtime=60
directory=${FIO_TARGET}
stonewall
[SEQ1M-Q8T1-Read]
iodepth=8
bs=1m
rw=read
[SEQ1M-Q8T1-Write]
iodepth=8
bs=1m
rw=write
[SEQ1M-Q1T1-Read]
bs=1m
rw=read
[SEQ1M-Q1T1-Write]
bs=1m
rw=write
[RND4K-Q32T16-Read]
iodepth=32
numjobs=16
bs=4k
rw=randread
group_reporting
[RND4K-Q32T16-Write]
iodepth=32
numjobs=16
bs=4k
rw=randwrite
group_reporting
[RND4K-Q1T1-Read]
bs=4k
rw=randread
[RND4K-Q1T1-Write]
bs=4k
rw=randwrite
[global]
ioengine=libaio
iodepth=1
numjobs=1
size=1g
direct=1
runtime=60
directory=${FIO_TARGET}
stonewall
[SEQ1M-Q8T1-Read]
bs=1m
iodepth=8
rw=read
[SEQ1M-Q8T1-Write]
bs=1m
iodepth=8
rw=write
[SEQ128K-Q32T1-Read]
bs=128k
iodepth=32
rw=read
[SEQ128K-Q32T1-Write]
bs=128k
iodepth=32
rw=write
[RND4K-Q32T16-Read]
bs=4k
iodepth=32
numjobs=16
rw=randread
group_reporting
[RND4K-Q32T16-Write]
bs=4k
iodepth=32
numjobs=16
rw=randwrite
group_reporting
[RND4K-Q1T1-Read]
bs=4k
rw=randread
[RND4K-Q1T1-Write]
bs=4k
rw=randwrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment