小ネタ Raspi3+Ubuntu16.04+SDCZ48-128G Fio
Raspi3でベンチマークする
- RaspberryPi 3はElement14製の方
- ubuntuは公式の
ubuntu-16.04-preinstalled-server-armhf+raspi3.img.xz
を利用 - SDCZ48-128GについてはSMARTの値が正しく参照できず
ベンチマーク上の留意点
ハードウェア情報
- メモリ 1GB
root@ubuntu:~# free --si -mw total used free shared buffers cache available Mem: 942 37 596 5 19 289 870 Swap: 0 0 0
- CPU ARM 4スレッド
root@ubuntu:~# cat /proc/cpuinfo | grep "model name" | uniq -c 4 model name : ARMv7 Processor rev 4 (v7l)
- USB
ubuntu@ubuntu:~$ lsusb | grep San Bus 001 Device 005: ID 0781:5581 SanDisk Corp. Ultra Bus 001 Device 004: ID 0781:5581 SanDisk Corp. Ultra ubuntu@ubuntu:~$ lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M |__ Port 3: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M |__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ベンチマーク環境
- マウント状態
root@ubuntu:~# mkdir /mnt/USB01 root@ubuntu:~# mount -t ext4 -o noatime,discard /dev/sda1 /mnt/USB01/ root@ubuntu:~# df /mnt/USB01/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 119269620 60984 113127000 1% /mnt/USB01 root@ubuntu:~# mount | grep USB /dev/sda1 on /mnt/USB01 type ext4 (rw,noatime,discard,data=ordered)
ベンチマーク実施
- ベンチマーク用dir掘って移動
root@ubuntu:~# mkdir /mnt/USB01/fio root@ubuntu:~# cd /mnt/USB01/fio
- 設定は後々比較するものでもない小ネタなので手抜き。重いものはメモリで死ぬだろうと予測して軽めのベンチ
root@ubuntu:/mnt/USB01/fio# fio --size=30m --numjobs=4 --iodepth=8 --time_based --runtime=60 --overwrite=1 --ioengine=libaio --bs=4k --group_reporting --direct=1 --name=test --rw=read | grep iops= read : io=882528KB, bw=14707KB/s, iops=3676, runt= 60009msec root@ubuntu:/mnt/USB01/fio# fio --size=30m --numjobs=4 --iodepth=8 --time_based --runtime=60 --overwrite=1 --ioengine=libaio --bs=4k --group_reporting --direct=1 --name=test --rw=write | grep iops= write: io=627904KB, bw=10463KB/s, iops=2615, runt= 60010msec root@ubuntu:/mnt/USB01/fio# fio --size=30m --numjobs=4 --iodepth=8 --time_based --runtime=60 --overwrite=1 --ioengine=libaio --bs=4k --group_reporting --direct=1 --name=test --rw=randread | grep iops= read : io=158516KB, bw=2639.8KB/s, iops=659, runt= 60050msec root@ubuntu:/mnt/USB01/fio# fio --size=30m --numjobs=4 --iodepth=8 --time_based --runtime=60 --overwrite=1 --ioengine=libaio --bs=4k --group_reporting --direct=1 --name=test --rw=randwrite | grep iops= write: io=109504KB, bw=1823.2KB/s, iops=455, runt= 60064msec
設定の整形
- size 30m ... 特に数値に根拠なし
- numjobs 4 ... スレッド数に合わせる
- iodepth 8 ... スレッド数との積が32になるよう設定
- blocksize 4k
- time_based , runtime=60 , overwrite=1
- ioengine libaio
結果の整形
test | total io | bw | iops | runtime |
---|---|---|---|---|
Seq_Read | io=882528KB | bw=14707KB/s | iops=3676 | runt= 60009msec |
Seq_Write | io=627904KB | bw=10463KB/s | iops=2615 | runt= 60010msec |
Rand_read | io=158516KB | bw=2639.8KB/s | iops=659 | runt= 60050msec |
Rand_write | io=109504KB | bw=1823.2KB/s | iops=455 | runt= 60064msec |
まとめ
- 同じUSBメモリで他の環境で試していないため断言できないが遅い
- Read100MB/s以上を謳っているがシーケンシャルでも14MB/s
- USB2.0でもよく言われている実効速度目安が30MB/s程度のためそれと比較しても遅い
- RW共にランダムで大きく値が落ちた
- ラズパイは速度期待するものではないので周辺機器は消費電力を基準に選んだ方がよさそう
追記もあるよ
続きを読むランサムウェアシミュレータを体験する
@Sh1n0g1氏のランサムウェアシミュレータを試します
- ランサムウェアが攻撃の一般的な手法の一つとして定着している
- 実際に被害に会うまでどのような攻撃なのか、知識として理解しても体験しづらい
- シミュレータを作成してくれた方がいるので実際に実行し、体験する
ランサムウェアシミュレーター「ShinoLocker」を公開しました。https://t.co/zeDUHLSws5でアクセスできます。YouTubeにデモ動画もあるので、見たいだけという方はこちらへ。https://t.co/gl3b6obvvY
— Shøta Shinogۜi ♾ (@Sh1n0g1) August 2, 2016
downloadから
BUILD
を選択作成された
shinolocker.exe
を実行windownsの保護が実行されるが
詳細の設定
から実行を選択無事(?)デスクトップ上の画像ファイルが暗号化された
アクセスすると実行ファイル形式となり、ShinoLockerが起動します
https://shinolocker.com/ にて出力されたHOST IDとTRANSACRION IDを入力します
Keyが出力されます
入力して
Descrtyot Files & Imomstall Me
を実行無事ファイルが復元されました
感想
fioのあまり使わないオプションを試す(前)
備忘録
--cmdhelp
で出てくるサブコマンドではなく --help
で出てくるほう
--crctest
Test speed of checksum functions
- チェックサムの計算スピードでいいんかな
[comicsong@comicsong fio]$ fio --crctest md5: 391.00 MB/sec crc64: 262.93 MB/sec crc32: 231.37 MB/sec crc32c: 6337.89 MB/sec crc16: 253.15 MB/sec crc7: 296.96 MB/sec sha1: 293.34 MB/sec sha256: 115.25 MB/sec sha512: 187.89 MB/sec xxhash: 3704.94 MB/sec murmur3: 1817.99 MB/sec jhash: 1285.14 MB/sec fnv: 4753.50 MB/sec
--cpuclock-test
Perform test/validation of CPU clock
- CPUのクロック速度計測
[comicsong@comicsong fio]$ fio --cpuclock-test cs: reliable_tsc: yes time 11788 cycles[0]=2493 time 11788 cycles[1]=2493 . . . time 11788 cycles[48]=2494 time 11788 cycles[49]=2494 time 11788 avg: 2493 time 11788 min=2493, max=2494, mean=2493.160000, S=0.007407 time 11788 inv_cycles_per_usec=6729 time 11788 cycles_start=2558090280267038 cs: Testing 4 CPUs cs: cpu 2: 71837406 clocks seen, first 2558090280570351 cs: cpu 1: 72369018 clocks seen, first 2558090280565014 cs: cpu 0: 75182683 clocks seen, first 2558090280552639 cs: cpu 3: 73019098 clocks seen, first 2558090283188198 cs: Pass!
- 50回計測。
/proc/cpuinfo
の値はこんななのでほぼ近似値
[comicsong@comicsong fio]$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 42 model name : Intel(R) Core(TM) i3-2100T CPU @ 2.50GHz stepping : 7 microcode : 0x29 cpu MHz : 1600.000 cache size : 3072 KB physical id : 0 siblings : 4 core id : 0 //後略
cpu MHz
の値とはズレている- 内容を読み取るのではなく何か実行させ、実クロックを計測と思われる
--showcmd
Turn a job file into command line options
- jobファイルに指定された内容をコマンドライン形式にして表示。テスト自体は実行されず
[comicsong@comicsong fio]$ fio fio.ini --showcmd fio --directory=/mnt/SSD/fio/tmp/ --size=5m --numjobs=4 --iodepth=1 --time_based --runtime=5 --overwrite=1 --ioengine=libaio --bs=4k --group_reporting --direct=1 --name=test
--eta=
When ETA estimate should be printed
終了予定時間の表示、例えば10分のjobを開始したときに実行中出る表示の差はこんな感じに
never
指定
[comicsong@comicsong fio]$ fio fio.ini --runtime=600 --eta=never test: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1 ... fio-2.13-18-gc915 Starting 4 processes
always
指定
[comicsong@comicsong fio]$ fio fio.ini --runtime=600 --eta=always test: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1 ... fio-2.13-18-gc915 Starting 4 processes Jobs: 4 (f=4): [R(4)] [1.2% done] [74352KB/0KB/0KB /s] [18.6K/0/0 iops] [eta 09m:54s]
--eta-newline=time
Force a new line for every 'time' period passed
- ETAを表示させる場合、指定の秒数で行更新させる
- 指定しない場合は行の更新はなし、また
--eta=never
の場合は特に何も表示/更新されない
[comicsong@comicsong fio]$ fio fio.ini --runtime=600 --eta=always --eta-newline=5 test: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1 ... fio-2.13-18-gc915 Starting 4 processes Jobs: 4 (f=4): [R(4)] [1.3% done] [62948KB/0KB/0KB /s] [15.8K/0/0 iops] [eta 09m:53s] Jobs: 4 (f=4): [R(4)] [2.3% done] [62456KB/0KB/0KB /s] [15.7K/0/0 iops] [eta 09m:47s] Jobs: 4 (f=4): [R(4)] [3.3% done] [74064KB/0KB/0KB /s] [18.6K/0/0 iops] [eta 09m:41s] Jobs: 4 (f=4): [R(4)] [4.3% done] [72924KB/0KB/0KB /s] [18.3K/0/0 iops] [eta 09m:35s] Jobs: 4 (f=4): [R(4)] [5.3% done] [73384KB/0KB/0KB /s] [18.4K/0/0 iops] [eta 09m:29s] Jobs: 4 (f=4): [R(4)] [6.3% done] [72464KB/0KB/0KB /s] [18.2K/0/0 iops] [eta 09m:23s] Jobs: 4 (f=4): [R(4)] [7.3% done] [70652KB/0KB/0KB /s] [17.7K/0/0 iops] [eta 09m:17s]