5400rpm

人生シングルスレッド

discardオプション追試

経緯と前回のテスト

  • 前回の検証では randwrite のみの検証を実施した
    • 上書きした場合の速度差を見るためであり他のテストでも差があることは変わらないと思わる
    • 本当にそうなのかを調べるために複数のioパターンで追試する

e6zout.hatenablog.jp

fio実施内容

  • コマンド
for TEST in read write readwrite randread randwrite randrw
  do for NUM in {1..5}
    do echo -n "${TEST}_${NUM} :"
    fio fio.ini -rw ${TEST} | grep "iops="
    /bin/rm -r /mnt/SSD/fio/tmp/*
  done
  echo "----------------------"
done
  • 設定
[global]
directory=/mnt/SSD/fio/tmp/
size=25g
numjobs=8
iodepth=4
time_based
runtime=90
overwrite=1
ioengine=libaio
bs=4k
group_reporting
direct=1

[test]

discardオプション有効

  • discardオプションが有効なことを確認
[comicsong@comicsong ~]$ mount | grep sda
/dev/sda1 on /mnt/SSD type xfs (rw,noatime,attr2,discard,inode64,noquota)
  • 実施
read_1 :  read : io=9874.5MB, bw=112347KB/s, iops=28086, runt= 90002msec
read_2 :  read : io=10544MB, bw=119960KB/s, iops=29990, runt= 90003msec
read_3 :  read : io=9873.3MB, bw=112333KB/s, iops=28083, runt= 90002msec
read_4 :  read : io=8805.9MB, bw=100189KB/s, iops=25047, runt= 90002msec
read_5 :  read : io=10569MB, bw=120251KB/s, iops=30062, runt= 90001msec
----------------------
write_1 :  write: io=9878.2MB, bw=112389KB/s, iops=28097, runt= 90002msec
write_2 :  write: io=9708.2MB, bw=110455KB/s, iops=27613, runt= 90002msec
write_3 :  write: io=9734.8MB, bw=110758KB/s, iops=27689, runt= 90001msec
write_4 :  write: io=9837.2MB, bw=111924KB/s, iops=27980, runt= 90001msec
write_5 :  write: io=9889.9MB, bw=112513KB/s, iops=28128, runt= 90002msec
----------------------
readwrite_1 :  read : io=981.31MB, bw=11163KB/s, iops=2790, runt= 90014msec
  write: io=982.93MB, bw=11182KB/s, iops=2795, runt= 90014msec
readwrite_2 :  read : io=995128KB, bw=11055KB/s, iops=2763, runt= 90015msec
  write: io=997188KB, bw=11078KB/s, iops=2769, runt= 90015msec
readwrite_3 :  read : io=991504KB, bw=11014KB/s, iops=2753, runt= 90020msec
  write: io=993372KB, bw=11035KB/s, iops=2758, runt= 90020msec
readwrite_4 :  read : io=997036KB, bw=11077KB/s, iops=2769, runt= 90012msec
  write: io=999016KB, bw=11099KB/s, iops=2774, runt= 90012msec
readwrite_5 :  read : io=976.72MB, bw=11111KB/s, iops=2777, runt= 90016msec
  write: io=978.31MB, bw=11129KB/s, iops=2782, runt= 90016msec
----------------------
randread_1 :  read : io=10929MB, bw=124343KB/s, iops=31085, runt= 90001msec
randread_2 :  read : io=10932MB, bw=124379KB/s, iops=31094, runt= 90002msec
randread_3 :  read : io=10934MB, bw=124401KB/s, iops=31100, runt= 90002msec
randread_4 :  read : io=10928MB, bw=124332KB/s, iops=31082, runt= 90002msec
randread_5 :  read : io=10925MB, bw=124304KB/s, iops=31075, runt= 90001msec
----------------------
randwrite_1 :  write: io=9951.8MB, bw=113226KB/s, iops=28306, runt= 90002msec
randwrite_2 :  write: io=10025MB, bw=114061KB/s, iops=28515, runt= 90002msec
randwrite_3 :  write: io=9910.8MB, bw=112751KB/s, iops=28187, runt= 90002msec
randwrite_4 :  write: io=9987.4MB, bw=113631KB/s, iops=28407, runt= 90002msec
randwrite_5 :  write: io=9938.7MB, bw=113079KB/s, iops=28269, runt= 90001msec
----------------------
randrw_1 :  read : io=1039.9MB, bw=11831KB/s, iops=2957, runt= 90005msec
  write: io=1041.2MB, bw=11844KB/s, iops=2960, runt= 90005msec
randrw_2 :  read : io=1040.2MB, bw=11833KB/s, iops=2958, runt= 90017msec
  write: io=1041.3MB, bw=11845KB/s, iops=2961, runt= 90017msec
randrw_3 :  read : io=1038.2MB, bw=11810KB/s, iops=2952, runt= 90015msec
  write: io=1039.4MB, bw=11824KB/s, iops=2955, runt= 90015msec
randrw_4 :  read : io=1038.6MB, bw=11816KB/s, iops=2954, runt= 90005msec
  write: io=1039.9MB, bw=11830KB/s, iops=2957, runt= 90005msec
randrw_5 :  read : io=1037.8MB, bw=11797KB/s, iops=2949, runt= 90017msec
  write: io=1038.4MB, bw=11812KB/s, iops=2952, runt= 90017msec

discardオプション無効

  • discardオプションを付けづにマウント
[comicsong@comicsong fio]$ sudo umount /mnt/SSD
[sudo] password for comicsong:
[comicsong@comicsong fio]$ sudo mount -o noatime /dev/sda1 /mnt/SSD
[comicsong@comicsong fio]$ mount | grep sda | grep -c dis
0
[comicsong@comicsong fio]$ mount | grep sda
/dev/sda1 on /mnt/SSD type xfs (rw,noatime,attr2,inode64,noquota)
read_1 :  read : io=8131.3MB, bw=92512KB/s, iops=23128, runt= 90003msec
read_2 :  read : io=7818.1MB, bw=88959KB/s, iops=22239, runt= 90003msec
read_3 :  read : io=10876MB, bw=123749KB/s, iops=30937, runt= 90001msec
read_4 :  read : io=8464.1MB, bw=96310KB/s, iops=24077, runt= 90002msec
read_5 :  read : io=9255.1MB, bw=105311KB/s, iops=26327, runt= 90001msec
----------------------
write_1 :  write: io=9943.4MB, bw=113132KB/s, iops=28283, runt= 90001msec
write_2 :  write: io=9946.6MB, bw=113168KB/s, iops=28291, runt= 90002msec
write_3 :  write: io=9912.6MB, bw=112780KB/s, iops=28194, runt= 90002msec
write_4 :  write: io=9922.8MB, bw=112897KB/s, iops=28224, runt= 90001msec
write_5 :  write: io=9947.6MB, bw=113178KB/s, iops=28294, runt= 90002msec
----------------------
readwrite_1 :  read : io=997936KB, bw=11086KB/s, iops=2771, runt= 90016msec
  write: io=999824KB, bw=11107KB/s, iops=2776, runt= 90016msec
readwrite_2 :  read : io=989416KB, bw=10992KB/s, iops=2748, runt= 90011msec
  write: io=991060KB, bw=11010KB/s, iops=2752, runt= 90011msec
readwrite_3 :  read : io=997088KB, bw=11078KB/s, iops=2769, runt= 90007msec
  write: io=999060KB, bw=11100KB/s, iops=2774, runt= 90007msec
readwrite_4 :  read : io=992216KB, bw=11024KB/s, iops=2755, runt= 90008msec
  write: io=994244KB, bw=11046KB/s, iops=2761, runt= 90008msec
readwrite_5 :  read : io=995800KB, bw=11063KB/s, iops=2765, runt= 90014msec
  write: io=997848KB, bw=11085KB/s, iops=2771, runt= 90014msec
----------------------
randread_1 :  read : io=11061MB, bw=125845KB/s, iops=31461, runt= 90002msec
randread_2 :  read : io=11059MB, bw=125831KB/s, iops=31457, runt= 90001msec
randread_3 :  read : io=11041MB, bw=125617KB/s, iops=31404, runt= 90001msec
randread_4 :  read : io=11038MB, bw=125587KB/s, iops=31396, runt= 90001msec
randread_5 :  read : io=11028MB, bw=125478KB/s, iops=31369, runt= 90001msec
----------------------
randwrite_1 :  write: io=9995.2MB, bw=113720KB/s, iops=28430, runt= 90002msec
randwrite_2 :  write: io=10032MB, bw=114140KB/s, iops=28534, runt= 90002msec
randwrite_3 :  write: io=10000MB, bw=113776KB/s, iops=28444, runt= 90002msec
randwrite_4 :  write: io=9874.8MB, bw=112350KB/s, iops=28087, runt= 90002msec
randwrite_5 :  write: io=9975.4MB, bw=113496KB/s, iops=28373, runt= 90001msec
----------------------
randrw_1 :  read : io=1033.7MB, bw=11758KB/s, iops=2939, runt= 90016msec
  write: io=1034.8MB, bw=11771KB/s, iops=2942, runt= 90016msec
randrw_2 :  read : io=1034.2MB, bw=11763KB/s, iops=2940, runt= 90024msec
  write: io=1035.2MB, bw=11775KB/s, iops=2943, runt= 90024msec
randrw_3 :  read : io=1027.6MB, bw=11690KB/s, iops=2922, runt= 90007msec
  write: io=1028.5MB, bw=11700KB/s, iops=2925, runt= 90007msec
randrw_4 :  read : io=1029.2MB, bw=11708KB/s, iops=2927, runt= 90014msec
  write: io=1030.4MB, bw=11721KB/s, iops=2930, runt= 90014msec
randrw_5 :  read : io=1027.4MB, bw=11689KB/s, iops=2922, runt= 90005msec
  write: io=1028.4MB, bw=11699KB/s, iops=2924, runt= 90005msec
  • 小まとめ
    • 意外と差が出ない。よくよく考えると前回は ext4, 今回は xfs と追試になっていなかった
    • xfsではdiscard有効時のオーバヘッドは微々たるものと判断しする
    • 同テストを再度ext4に対して行い、ファイルシステムによるオーバヘッドの差異という形で確認する