# iosnoop & fio # Eike Holtz - slac 2018 # https://eholtz.de iosnoop . Brendan Gregg . https://github.com/brendangregg/perf-tools/blob/master/iosnoop . ftrace-framework . debian: apt install perftools-unstable . ansonsten: git clone ... iosnoop daten . COMM ausgeführtes Kommando . PID process id . TYPE typ des IO (Read, Write, Sync, Flush, ...) . DEV Device (ls -l /dev/block) . BLOCK Sektor wo der IO aufgetreten ist . BYTES Anzahl der Bytes . LATms Latency in Millisekunden fio . Jens Axboe . https://github.com/axboe/fio . flexible i/o-tester . apt/dnf install fio . https://www.thomas-krenn.com/de/wiki/Fio_Grundlagen fio / bssplit . --bssplit=4k:8k/20:32k/10,4k:512/10 . Lesend: 10% 32k i/os, 20% 8k i/os, 4k (100-30)=70% i/os . Schreibend: 10% 512byte i/os, (100-10)=90% 4k i/os fio / rwmixread . --rwmixread=20 . 20% des ios ist lesend fio / sonstiges . --ioengine=libaio (guter Default, es sei denn es gibt spezielle Anforderungen) . --iodepth=x (x parallele Threads für den io) . --direct=1 (für direkten io => WS) . --time_based=1 --timeout=300 (fünf Minuten lang testen) cheatsheet iosnoop 1 # trace i/o 1 second bufferd grep "\WW[A-Z]*\W" # grep for writes in iosnoop file grep "\WR[A-Z]*\W" # grep for reads in iosnoop file grep "\WW[A-Z]*\W" | awk -f quantize.awk # quantize block sizes for i in $(seq 512 512 $((512*10000))); do dd if=/home/eholtz/Downloads/debian-9.4.0-amd64-netinst.iso of=./file bs=$i count=1 ; done # dd with increasing block size fio --readwrite=randrw --name=slac --size=100M # minimal fio --readwrite=randrw --name=slac --size=100M --bssplit=4k/66:8k/17:12k/5:16k/5:20k/1:24k/1,8k/20:16k/20:4k/60 --rwmixread=20 --ioengine=libaio --direct=1 --time_based=1 --timeout=60 # most sophisticated for today for i in $(seq 2 2 32) ; do echo $i 1>&2 ; fio --readwrite=randrw --name=slac --size=100M --bssplit=16k/47:512/9,16k/18:4k/7 --direct=1 --ioengine=libaio --iodepth=$i ; done | grep IOPS # increase iothreads cat > quantize.awk << EOF { if ( $6 ~ /^[0-9]+$/) { v=$6 n=512; while (v>n) { n=n*2; } if (n>max) max=n; ++f[n]; ++total } } END { printf("%10s %10s %3s\n","blocksize","count","%"); for(i=512;i<=max;++i) { if (f[i]>0) { pc=f[i]/total*100; printf("%10d %10d %3d\n",i,f[i],pc); } } printf("%10s %10d\n","total",total); } EOF