fio

みんな大好きCrystalDiskMarkっぽい出力をするfioのスクリプト「fio-cmd」に修正を加えました.
まずオリジナルのhttps://github.com/buty4649/fio-cdm様.
そしてfioのversion3向けの修正を行った参照先様.
には敬意を表します.

これらを参考にして、kM/sでの換算部分を修正しました.
こんな感じに.

オリジナル:     split(gensub(/bw=([0-9.]+)(([KM]?)B\/s,)?/,"\\1 \\3", "g", i), a);
 ↓
version3対応版: split(gensub(/\((([1-9]+[0-9]*|0)(\.[0-9]+)?)([KM]?[^i]?B\/s)?\)/,"\\1 \\2", "g", i), a);
 ↓
ここ:           split(gensub(/\(([0-9.]+)([kM]?[^i]?B\/s)?\)/,"\\1 \\2 \\3", "g", i), a);

合わせて、内部のn(i)関数を下記のようにしてます.

    function n(i) {
      split(gensub(/\(([0-9.]+)([kM]?[^i]?B\/s)?\)/,"\\1 \\2 \\3", "g", i), a);
      s = a[1]; u = a[2];
      if(u == "kB/s") {s /= 1024}
      if(u == "B/s")  {s /= 1024 * 1024}
      return s;
    }

っで作ったfio-cmd_200428.shが下記になります.

すべて開くすべて閉じる
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
-
!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
-
!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#! /bin/bash
 
TARGET="$1"
FileName=".fio-diskmark"
 
fio -version
echo ${TARGET}
 
fio2cdm() {
    awk '
    /^Seq-Read:/          {getline;if($1~/^read/) {seqread =$4} }
    /^Seq-Write:/         {getline;if($1~/^write/){seqwrite=$4} }
    /^Rand-Read-512K:/    {getline;if($1~/^read/) {rread512 =$4} }
    /^Rand-Write-512K:/   {getline;if($1~/^write/){rwrite512=$4} }
    /^Rand-Read-4K:/      {getline;if($1~/^read/) {rread4 =$4} }
    /^Rand-Write-4K:/     {getline;if($1~/^write/){rwrite4=$4} }
    /^Rand-Read-4K-QD32:/ {getline;if($1~/^read/) {rread4qd32 =$4} }
    /^Rand-Write-4K-QD32:/{getline;if($1~/^write/){rwrite4qd32=$4} }
 
    function n(i) {
      split(gensub(/\(([0-9.]+)([kM]?[^i]?B\/s)?\)/,"\\1 \\2 \\3", "g", i), a);
      s = a[1]; u = a[2];
      if(u == "kB/s") {s /= 1000}
      if(u == "B/s")  {s /= 1000 * 1000}
      return s;
    }
    END {
      print ("|      | Read(MB/s)|Write(MB/s)|");
      print ("|------|-----------|-----------|");
      printf("|  Seq |%11.3f|%11.3f|\n", n(seqread),   n(seqwrite));
      printf("| 512K |%11.3f|%11.3f|\n", n(rread512),  n(rwrite512));
      printf("|   4K |%11.3f|%11.3f|\n", n(rread4),    n(rwrite4));
      printf("|4KQD32|%11.3f|%11.3f|\n", n(rread4qd32),n(rwrite4qd32));
    }
    '
}
 
 
trap "rm -f ${TARGET}/${FileName}" 0 1 2 3 9 15
 
# see. http://www.winkey.jp/article.php/20110310142828679
cat <<_EOL_ | fio - | fio2cdm
[global]
ioengine=sync
iodepth=1
size=1g
direct=1
runtime=60
directory=${TARGET}
filename=${FileName}
 
[Seq-Read]
bs=1m
rw=read
stonewall
 
[Seq-Write]
bs=1m
rw=write
stonewall
 
[Rand-Read-512K]
bs=512k
rw=randread
stonewall
 
[Rand-Write-512K]
bs=512k
rw=randwrite
stonewall
 
[Rand-Read-4K]
bs=4k
rw=randread
stonewall
 
[Rand-Write-4K]
bs=4k
rw=randwrite
stonewall
 
[Rand-Read-4K-QD32]
iodepth=32
bs=4k
rw=randread
stonewall
 
[Rand-Write-4K-QD32]
iodepth=32
bs=4k
rw=randwrite
stonewall
_EOL_

IOPSの表記

iopsの値も知りたかったのでもうちょっと調整しました.

すべて開くすべて閉じる
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
-
!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
-
!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#! /bin/bash
 
TARGET="$1"
FileName=".fio-diskmark"
 
fio -version
echo ${TARGET}
 
fio2cdm() {
    awk '
    /^Seq-Read:/          {getline;if($1~/^read/) {seqread =$4;seqreadiops=$2} }
    /^Seq-Write:/         {getline;if($1~/^write/){seqwrite=$4;seqwriteiops=$2} }
    /^Rand-Read-512K:/    {getline;if($1~/^read/) {rread512=$4;rread512iops=$2} }
    /^Rand-Write-512K:/   {getline;if($1~/^write/){rwrite512=$4;rwrite512iops=$2} }
    /^Rand-Read-4K:/      {getline;if($1~/^read/) {rread4=$4;rread4iops=$2} }
    /^Rand-Write-4K:/     {getline;if($1~/^write/){rwrite4=$4;rwrite4iops=$2} }
    /^Rand-Read-4K-QD32:/ {getline;if($1~/^read/) {rread4qd32=$4;rread4qd32iops=$2} }
    /^Rand-Write-4K-QD32:/{getline;if($1~/^write/){rwrite4qd32=$4;rwrite4qd32iops=$2} }
 
    function n(i) {
      split(gensub(/\(([0-9.]+)([kM]?[^i]?B\/s)?\)/,"\\1 \\2 \\3", "g", i), a);
      s = a[1]; u = a[2];
      if(u == "kB/s") {s /= 1000}
      if(u == "B/s")  {s /= 1000 * 1000}
      return s;
    }
    function iops(i) {
      split(gensub(/IOPS=([0-9.]+)([kM]?),/,"\\1 \\2 \\3", "g", i), a);
      s = a[1]; u = a[2];
      if(u == "k") {s *= 1000}
      if(u == "M")  {s *= 1000 * 1000}
      return s;
    }
    END {
      print ("|      | Read(MB/s) (iops)|Write(MB/s) (iops)|");
      print ("|------|------------------|------------------|");
      printf("|  Seq |%11.3f(%5d)|%11.3f(%5d)|\n", n(seqread),   iops(seqreadiops),   n(seqwrite),   iops(seqwriteiops));
      printf("| 512K |%11.3f(%5d)|%11.3f(%5d)|\n", n(rread512),  iops(rread512iops),  n(rwrite512),  iops(rwrite512iops));
      printf("|   4K |%11.3f(%5d)|%11.3f(%5d)|\n", n(rread4),    iops(rread4iops),    n(rwrite4),    iops(rwrite4iops));
      printf("|4KQD32|%11.3f(%5d)|%11.3f(%5d)|\n", n(rread4qd32),iops(rread4qd32iops),n(rwrite4qd32),iops(rwrite4qd32iops));
    }
    '
}
 
 
trap "rm -f ${TARGET}/${FileName}" 0 1 2 3 9 15
 
# see. http://www.winkey.jp/article.php/20110310142828679
cat <<_EOL_ | fio - | fio2cdm
[global]
ioengine=sync
iodepth=1
size=512m
direct=1
runtime=60
directory=${TARGET}
filename=${FileName}
 
[Seq-Read]
bs=1m
rw=read
stonewall
 
[Seq-Write]
bs=1m
rw=write
stonewall
 
[Rand-Read-512K]
bs=512k
rw=randread
stonewall
 
[Rand-Write-512K]
bs=512k
rw=randwrite
stonewall
 
[Rand-Read-4K]
bs=4k
rw=randread
stonewall
 
[Rand-Write-4K]
bs=4k
rw=randwrite
stonewall
 
[Rand-Read-4K-QD32]
iodepth=32
bs=4k
rw=randread
stonewall
 
[Rand-Write-4K-QD32]
iodepth=32
bs=4k
rw=randwrite
stonewall
_EOL_

トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2020-04-29 (水) 22:41:50 (30d)