Skip to content

Instantly share code, notes, and snippets.

View tobert's full-sized avatar
💭
🏳️‍🌈 💻 🏳️‍🌈

Amy Tobey tobert

💭
🏳️‍🌈 💻 🏳️‍🌈
View GitHub Profile
@tobert
tobert / fio-output.txt
Created March 31, 2014 20:51
Line noise
atobey@zorak ~/src/disk-latency-benchmarking $ sudo fio 4threads.fio
bgwriter: (g=0): rw=randwrite, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=32
queryA: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=mmap, iodepth=1
queryB: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=mmap, iodepth=1
bgupdater: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=16
fio-2.1.6.1
Starting 4 processes
bgwriter: Laying out IO file(s) (1 file(s) / 256MB)
queryA: Laying out IO file(s) (1 file(s) / 256MB)
queryB: Laying out IO file(s) (1 file(s) / 256MB)
@tobert
tobert / samsung_840_evo_ss.txt
Created April 1, 2014 20:51
Samsung 840 EVO sector size
atobey@brak ~ $ sudo sginfo /dev/sda
INQUIRY response (cmd: 0x12)
----------------------------
Device Type 0
Vendor: ATA
Product: Samsung SSD 840
Revision level: DXM0
atobey@brak ~ $ cat /sys/block/sda/queue/physical_block_size
512
@tobert
tobert / gist:9925843
Created April 2, 2014 00:32
Samsung 840 Pro getting destroyed by some old 7200RPM SAS drives on sequential reads
avg-cpu: %user %nice %system %iowait %steal %idle
3.03 0.00 8.96 0.00 0.00 88.01
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sde 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdf 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdh 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdc 0.00 0.00 20372.00 0.00 81488.00 0.00 8.00 0.89 0.04 0.04 0.00 0.04 88.60
sdb 0.00 0.00 20386.00 0.00 81544.00 0.00 8.00 0.90 0.04 0.04 0.00 0.04 89.70
sda 0.00 0.00 20426.00 0.00 81704.00 0.00 8.00 0.92 0.05 0.05 0.00 0.05 92.00
@tobert
tobert / latstat.pl
Last active August 29, 2015 13:58
A quick prototype to make abuse of /proc/diskstats while benchmarking.
#!/usr/bin/env perl
$| = 1;
=head1 NAME
Latency Stat - parse & display some kernel IO metrics
=head1 DESCRIPTION
This script parses /proc/diskstats and prints updates every 2 seconds. A starting point for
@tobert
tobert / simple-read.fio
Created April 2, 2014 19:40
Simple fio config to read from local disks
[global]
# use the libaio backend, others include mmap, sg, sync, and many more
ioengine=libaio
# use unbuffered IO
direct=1
# only do reads, no writes
rw=read
# read 10GB of data before terminating
size=10g
@tobert
tobert / 7200rpmsas-vs-samsung840sata.txt
Created April 2, 2014 19:48
Output from simple-read.fio
atobey@zorak ~/src/disk-latency-benchmarking $ sudo fio simple-read.fio
/dev/disk/by-path/pci-0000:03:00.0-sas-0x5000c5000d7f7d21-lun-0: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1
/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S1ANNSADB05219A: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1
fio-2.1.6.1
Starting 2 processes
Jobs: 1 (f=1): [_R] [100.0% done] [45468KB/0KB/0KB /s] [11.4K/0/0 iops] [eta 00m:00s]
/dev/disk/by-path/pci-0000:03:00.0-sas-0x5000c5000d7f7d21-lun-0: (groupid=0, jobs=1): err= 0: pid=71369: Wed Apr 2 20:42:13 2014
read : io=10240MB, bw=63317KB/s, iops=15829, runt=165607msec
slat (usec): min=3, max=335, avg= 9.73, stdev= 5.76
clat (usec): min=1, max=18600, avg=51.29, stdev=16.79
@tobert
tobert / thrash.fio
Created April 2, 2014 22:08
Thrash the drive to push up slat if possible.
[global]
ioengine=libaio
direct=1
size=10g
unified_rw_reporting=1
[/dev/disk/by-path/pci-0000:03:00.0-sas-0x5000c5000d7f7d21-lun-0]
rw=randrw
atobey@zorak ~/src/disk-latency-benchmarking $ sudo fio --warnings-fatal --numjobs=8 thrash.fio
/dev/disk/by-path/pci-0000:03:00.0-sas-0x5000c5000d7f7d21-lun-0: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1
fio-2.1.6.1
Starting 1 thread
^Cbs: 1 (f=1): [m] [10.3% done] [624KB/0KB/0KB /s] [156/0/0 iops] [eta 04h:13m:04s]
fio: terminating on signal 2
/dev/disk/by-path/pci-0000:03:00.0-sas-0x5000c5000d7f7d21-lun-0: (groupid=0, jobs=1): err= 0: pid=71598: Wed Apr 2 23:26:42 2014
mixed: io=1052.9MB, bw=634595B/s, iops=154, runt=1739644msec
slat (usec): min=6, max=268, avg=21.13, stdev= 2.01
@tobert
tobert / dstat-snapshot.txt
Last active August 29, 2015 13:58
4 tests at once
--io/total- ---procs--- ------memory-usage----- ---paging-- -dsk/total- ---system-- ----total-cpu-usage---- -net/total-
read writ|run blk new| used buff cach free| in out | read writ| int csw |usr sys idl wai hiq siq| recv send
5361 5378 |0.3 0 0.1|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 42k| 1 2 97 0 0 0|1028B 2693B
5309 5326 |0.6 0 0|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 42k| 1 2 97 0 0 0| 814B 1593B
5310 5342 |0.4 0 0.1|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 42k| 1 2 97 0 0 0| 935B 2405B
5386 5313 |0.3 0 0.1|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 42k| 1 2 97 0 0 0| 810B 2489B
5321 5276 |0.3 0 0|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 41k| 1 2 97 0 0 0| 800B 1716B
5338 5329 |0.2 0 0|1406M 628k 3483M 10.6G| 0 0 | 21M 21M| 11k 42k| 1 2 97 0 0 0|1032B 1905B
5314 5339 |0.1 0 0.3|1406M 628k 3484M 10.6G| 0 0 | 21
@tobert
tobert / HOWTO.txt
Created April 3, 2014 00:31
Cool story
7.0 Terse output
----------------
For scripted usage where you typically want to generate tables or graphs
of the results, fio can output the results in a semicolon separated format.
The format is one long line of values, such as:
2;card0;0;0;7139336;121836;60004;1;10109;27.932460;116.933948;220;126861;3495.446807;1085.368601;226;126864;3523.635629;1089.012448;24063;99944;50.275485%;59818.274627;5540.657370;7155060;122104;60004;1;8338;29.086342;117.839068;388;128077;5032.488518;1234.785715;391;128085;5061.839412;1236.909129;23436;100928;50.287926%;59964.832030;5644.844189;14.595833%;19.394167%;123706;0;7313;0.1%;0.1%;0.1%;0.1%;0.1%;0.1%;100.0%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.01%;0.02%;0.05%;0.16%;6.04%;40.40%;52.68%;0.64%;0.01%;0.00%;0.01%;0.00%;0.00%;0.00%;0.00%;0.00%
A description of this job goes here.