fio¶
Présentation de l’outil¶
fio
(Flexible I/O Tester) est un outil de test de performance I/O qui est très flexible et configurable. Il est utilisé pour mesurer et analyser les performances des systèmes de stockage, y compris les disques durs, les SSD et les systèmes de fichiers. Cet outil est particulièrement utile pour les administrateurs système et les ingénieurs de stockage pour évaluer les performances des dispositifs de stockage.
Licence : GPL 2
Installation¶
Exemple d’utilisation¶
Après l’installation, vous pouvez exécuter fio
avec diverses options pour tester les performances de votre système de stockage. Voici un exemple simple qui effectue des tests de lectures et d’écritures séquentiels sur un fichier :
fio --name=exemple_test --ioengine=sync --rw=readwrite --bs=4k --numjobs=1 --size=1G --runtime=10m --time_based
Dans cet exemple :
--name=exemple_test
donne un nom au fichier utilisé pour le test--ioengine=sync
utilise une I/O synchrone, comme lors de l’écriture de journaux (voir les différents valeurs possibles)--rw=readwrite
effectue des opérations de lecture et d’écriture--bs=4k
définit la taille du bloc à 4 ko--numjobs=1
utilise un seul thread--size=1G
définit la taille du fichier de test à 1 Go--runtime=10m
définit la durée du test à 10 minutes--time_based
permet au test de continuer même après avoir atteint la taille du fichier.
Exemples de résultats¶
Ces valeurs sont purement indicatives et destinées à donner des ordres de grandeur.
À côté des valeurs READ
/WRITE
, observer aussi les IOPS
.
Les valeurs en lecture pure, ou avec de plus gros blocs, ou plus de jobs, peuvent être notablement plus élevées.
/var/lib/postgresql/hdd2/exemple.test.fio: (groupid=0, jobs=1): err= 0: pid=8400: Mon Mar 17 19:46:37 2025
read: IOPS=12.2k, BW=47.8MiB/s (50.1MB/s)(14.0GiB/300030msec)
clat (nsec): min=525, max=239866k, avg=28864.55, stdev=416228.45
lat (nsec): min=551, max=239866k, avg=28951.87, stdev=416226.63
clat percentiles (nsec):
| 1.00th=[ 596], 5.00th=[ 620], 10.00th=[ 636],
| 20.00th=[ 668], 30.00th=[ 700], 40.00th=[ 828],
| 50.00th=[ 2192], 60.00th=[ 2224], 70.00th=[ 2288],
| 80.00th=[ 2352], 90.00th=[ 2416], 95.00th=[ 2512],
| 99.00th=[1269760], 99.50th=[1548288], 99.90th=[3424256],
| 99.95th=[3555328], 99.99th=[4816896]
bw ( KiB/s): min= 16, max=324536, per=100.00%, avg=106052.60, stdev=29892.79, samples=277
iops : min= 4, max=81134, avg=26513.05, stdev=7473.20, samples=277
write: IOPS=12.2k, BW=47.8MiB/s (50.1MB/s)(14.0GiB/300030msec); 0 zone resets
clat (nsec): min=1447, max=43095k, avg=5006.00, stdev=39261.06
lat (nsec): min=1484, max=43095k, avg=5126.27, stdev=39266.43
clat percentiles (nsec):
| 1.00th=[ 1656], 5.00th=[ 1704], 10.00th=[ 1720], 20.00th=[ 1752],
| 30.00th=[ 1800], 40.00th=[ 2192], 50.00th=[ 6432], 60.00th=[ 6496],
| 70.00th=[ 6560], 80.00th=[ 6624], 90.00th=[ 6752], 95.00th=[ 7200],
| 99.00th=[16192], 99.50th=[19840], 99.90th=[28288], 99.95th=[32384],
| 99.99th=[58624]
bw ( KiB/s): min= 16, max=325216, per=100.00%, avg=105989.34, stdev=29826.37, samples=277
iops : min= 4, max=81304, avg=26497.23, stdev=7456.61, samples=277
lat (nsec) : 750=18.78%, 1000=1.85%
lat (usec) : 2=18.49%, 4=31.00%, 10=27.98%, 20=0.89%, 50=0.26%
lat (usec) : 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.02%
lat (msec) : 2=0.60%, 4=0.13%, 10=0.01%, 20=0.01%, 50=0.01%
lat (msec) : 100=0.01%, 250=0.01%
cpu : usr=2.76%, sys=12.15%, ctx=76799, majf=0, minf=18
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=3672311,3670224,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: bw=47.8MiB/s (50.1MB/s), 47.8MiB/s-47.8MiB/s (50.1MB/s-50.1MB/s), io=14.0GiB (15.0GB), run=300030-300030msec
WRITE: bw=47.8MiB/s (50.1MB/s), 47.8MiB/s-47.8MiB/s (50.1MB/s-50.1MB/s), io=14.0GiB (15.0GB), run=300030-300030msec
Disk stats (read/write):
dm-2: ios=55859/3678899, merge=0/0, ticks=221708/40482772, in_queue=40704480, util=99.58%, aggrios=66743/3680934, aggrmerge=0/0, aggrticks=3631192/28399148, aggrin_queue=32030340, aggrutil=99.21%
dm-3: ios=66743/3680934, merge=0/0, ticks=3631192/28399148, in_queue=32030340, util=99.21%, aggrios=111937/116126, aggrmerge=10469/3576097, aggrticks=501824/992112, aggrin_queue=1502919, aggrutil=86.70%
sdb: ios=111937/116126, merge=10469/3576097, ticks=501824/992112, in_queue=1502919, util=86.70%
/var/lib/postgresql/hdd1/exemple.test.fio: (groupid=0, jobs=1): err= 0: pid=8259: Mon Mar 17 19:31:36 2025
read: IOPS=16.2k, BW=63.2MiB/s (66.2MB/s)(19.0GiB/308075msec)
clat (nsec): min=528, max=2160.7M, avg=25800.40, stdev=2241396.20
lat (nsec): min=554, max=2160.7M, avg=25874.22, stdev=2241395.91
clat percentiles (nsec):
| 1.00th=[ 596], 5.00th=[ 620], 10.00th=[ 636],
| 20.00th=[ 660], 30.00th=[ 692], 40.00th=[ 764],
| 50.00th=[ 2192], 60.00th=[ 2224], 70.00th=[ 2320],
| 80.00th=[ 2384], 90.00th=[ 2448], 95.00th=[ 2544],
| 99.00th=[1003520], 99.50th=[1302528], 99.90th=[2408448],
| 99.95th=[2539520], 99.99th=[2736128]
bw ( KiB/s): min= 1024, max=327672, per=100.00%, avg=123408.11, stdev=40428.08, samples=323
iops : min= 256, max=81918, avg=30851.98, stdev=10107.04, samples=323
write: IOPS=16.2k, BW=63.1MiB/s (66.2MB/s)(19.0GiB/308075msec); 0 zone resets
clat (nsec): min=1468, max=2994.1k, avg=4818.08, stdev=11898.77
lat (nsec): min=1505, max=2994.4k, avg=4923.70, stdev=11914.85
clat percentiles (nsec):
| 1.00th=[ 1656], 5.00th=[ 1704], 10.00th=[ 1720], 20.00th=[ 1752],
| 30.00th=[ 1784], 40.00th=[ 2064], 50.00th=[ 6368], 60.00th=[ 6496],
| 70.00th=[ 6560], 80.00th=[ 6624], 90.00th=[ 6752], 95.00th=[ 7136],
| 99.00th=[15936], 99.50th=[19328], 99.90th=[27008], 99.95th=[30592],
| 99.99th=[44288]
bw ( KiB/s): min= 1050, max=326432, per=100.00%, avg=123335.24, stdev=40356.80, samples=323
iops : min= 262, max=81608, avg=30833.72, stdev=10089.21, samples=323
lat (nsec) : 750=19.62%, 1000=1.92%
lat (usec) : 2=19.69%, 4=29.81%, 10=27.06%, 20=0.91%, 50=0.22%
lat (usec) : 100=0.01%, 250=0.01%, 500=0.01%, 750=0.02%, 1000=0.23%
lat (msec) : 2=0.37%, 4=0.14%, 10=0.01%, 20=0.01%, 50=0.01%
lat (msec) : 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
lat (msec) : 2000=0.01%, >=2000=0.01%
cpu : usr=3.68%, sys=13.05%, ctx=88554, majf=0, minf=17
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=4980737,4977788,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: bw=63.2MiB/s (66.2MB/s), 63.2MiB/s-63.2MiB/s (66.2MB/s-66.2MB/s), io=19.0GiB (20.4GB), run=308075-308075msec
WRITE: bw=63.1MiB/s (66.2MB/s), 63.1MiB/s-63.1MiB/s (66.2MB/s-66.2MB/s), io=19.0GiB (20.4GB), run=308075-308075msec
Disk stats (read/write):
dm-1: ios=76474/640, merge=0/0, ticks=274724/180820, in_queue=455544, util=99.31%, aggrios=152691/156463, aggrmerge=0/75, aggrticks=470224/1011183, aggrin_queue=1486663, aggrutil=88.03%
sda: ios=152691/156463, merge=0/75, ticks=470224/1011183, in_queue=1486663, util=88.03%
/var/lib/postgresql/ssdraid/exemple.test.fio: (groupid=0, jobs=1): err= 0: pid=8497: Mon Mar 17 20:01:40 2025
read: IOPS=57.2k, BW=223MiB/s (234MB/s)(66.0GiB/302425msec)
clat (nsec): min=519, max=144547k, avg=3292.92, stdev=91637.87
lat (nsec): min=545, max=144548k, avg=3326.78, stdev=91638.14
clat percentiles (nsec):
| 1.00th=[ 628], 5.00th=[ 652], 10.00th=[ 668],
| 20.00th=[ 684], 30.00th=[ 700], 40.00th=[ 716],
| 50.00th=[ 732], 60.00th=[ 748], 70.00th=[ 772],
| 80.00th=[ 820], 90.00th=[ 1020], 95.00th=[ 2320],
| 99.00th=[ 2576], 99.50th=[ 7264], 99.90th=[ 741376],
| 99.95th=[ 839680], 99.99th=[1028096]
bw ( KiB/s): min= 4000, max=712952, per=100.00%, avg=472578.87, stdev=231575.76, samples=293
iops : min= 1000, max=178238, avg=118144.70, stdev=57893.96, samples=293
write: IOPS=57.2k, BW=223MiB/s (234MB/s)(66.0GiB/302425msec); 0 zone resets
clat (nsec): min=1012, max=1687.3k, avg=2312.48, stdev=5179.54
lat (nsec): min=1050, max=1687.4k, avg=2360.69, stdev=5190.27
clat percentiles (nsec):
| 1.00th=[ 1672], 5.00th=[ 1704], 10.00th=[ 1720], 20.00th=[ 1736],
| 30.00th=[ 1736], 40.00th=[ 1752], 50.00th=[ 1768], 60.00th=[ 1784],
| 70.00th=[ 1816], 80.00th=[ 1896], 90.00th=[ 2960], 95.00th=[ 6560],
| 99.00th=[ 7520], 99.50th=[ 9536], 99.90th=[17280], 99.95th=[19072],
| 99.99th=[27264]
bw ( KiB/s): min= 4032, max=704576, per=100.00%, avg=472438.20, stdev=231423.55, samples=293
iops : min= 1008, max=176144, avg=118109.48, stdev=57855.86, samples=293
lat (nsec) : 750=30.66%, 1000=14.16%
lat (usec) : 2=42.23%, 4=8.09%, 10=4.40%, 20=0.24%, 50=0.02%
lat (usec) : 100=0.01%, 250=0.05%, 500=0.03%, 750=0.07%, 1000=0.04%
lat (msec) : 2=0.01%, 4=0.01%, 10=0.01%, 20=0.01%, 50=0.01%
lat (msec) : 100=0.01%, 250=0.01%
cpu : usr=5.88%, sys=27.08%, ctx=295899, majf=0, minf=19
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=17301505,17296338,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: bw=223MiB/s (234MB/s), 223MiB/s-223MiB/s (234MB/s-234MB/s), io=66.0GiB (70.9GB), run=302425-302425msec
WRITE: bw=223MiB/s (234MB/s), 223MiB/s-223MiB/s (234MB/s-234MB/s), io=66.0GiB (70.8GB), run=302425-302425msec
Disk stats (read/write):
dm-6: ios=67697/2155, merge=0/0, ticks=136448/350504, in_queue=486952, util=98.32%, aggrios=534018/541282, aggrmerge=0/196, aggrticks=757264/46274483, aggrin_queue=47031747, aggrutil=94.51%
sdc: ios=534018/541282, merge=0/196, ticks=757264/46274483, in_queue=47031747, util=94.51%
/var/lib/postgresql/nvme/exemple.test.fio: (groupid=0, jobs=1): err= 0: pid=8590: Mon Mar 17 20:16:41 2025
read: IOPS=189k, BW=738MiB/s (774MB/s)(216GiB/300001msec)
clat (nsec): min=519, max=12415k, avg=1096.22, stdev=5649.64
lat (nsec): min=545, max=12415k, avg=1128.45, stdev=5651.47
clat percentiles (nsec):
| 1.00th=[ 612], 5.00th=[ 636], 10.00th=[ 660], 20.00th=[ 700],
| 30.00th=[ 732], 40.00th=[ 764], 50.00th=[ 796], 60.00th=[ 820],
| 70.00th=[ 844], 80.00th=[ 868], 90.00th=[ 916], 95.00th=[ 980],
| 99.00th=[ 1256], 99.50th=[43776], 99.90th=[46336], 99.95th=[47360],
| 99.99th=[66048]
bw ( KiB/s): min=23736, max=1092832, per=100.00%, avg=756393.98, stdev=307810.33, samples=599
iops : min= 5934, max=273208, avg=189098.53, stdev=76952.59, samples=599
write: IOPS=189k, BW=739MiB/s (774MB/s)(216GiB/300001msec); 0 zone resets
clat (nsec): min=884, max=1668.9k, avg=2090.53, stdev=1317.09
lat (nsec): min=920, max=1669.0k, avg=2134.63, stdev=1322.81
clat percentiles (nsec):
| 1.00th=[ 1672], 5.00th=[ 1704], 10.00th=[ 1736], 20.00th=[ 1752],
| 30.00th=[ 1816], 40.00th=[ 2040], 50.00th=[ 2064], 60.00th=[ 2096],
| 70.00th=[ 2096], 80.00th=[ 2128], 90.00th=[ 2320], 95.00th=[ 2896],
| 99.00th=[ 4448], 99.50th=[ 4896], 99.90th=[ 7008], 99.95th=[ 9664],
| 99.99th=[19584]
bw ( KiB/s): min=23896, max=1096000, per=100.00%, avg=756515.44, stdev=307821.65, samples=599
iops : min= 5974, max=274000, avg=189128.80, stdev=76955.42, samples=599
lat (nsec) : 750=17.07%, 1000=30.79%
lat (usec) : 2=20.04%, 4=30.87%, 10=0.88%, 20=0.03%, 50=0.31%
lat (usec) : 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
lat (msec) : 2=0.01%, 4=0.01%, 10=0.01%, 20=0.01%
cpu : usr=16.07%, sys=70.90%, ctx=44699, majf=0, minf=16
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=56711177,56720753,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: bw=738MiB/s (774MB/s), 738MiB/s-738MiB/s (774MB/s-774MB/s), io=216GiB (232GB), run=300001-300001msec
WRITE: bw=739MiB/s (774MB/s), 739MiB/s-739MiB/s (774MB/s-774MB/s), io=216GiB (232GB), run=300001-300001msec
Disk stats (read/write):
dm-0: ios=362618/15679, merge=0/0, ticks=34672/298196, in_queue=332868, util=34.78%, aggrios=362618/232822, aggrmerge=0/71, aggrticks=34680/10662602, aggrin_queue=10697304, aggrutil=33.80%
nvme0n1: ios=362618/232822, merge=0/71, ticks=34680/10662602, in_queue=10697304, util=33.80%