需要安装fio

yum install fio -y

有很多依赖包

 

 

FIO用法:

随机读:(可直接用,向磁盘写一个2G文件,10线程,随机读1分钟,给出结果)

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -numjobs=10 -runtime=60 -group_reporting -name=mytest -size=2G

显示结果:

  1. mytest: (g=0): rw=randread, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
  2. ...
  3. fio-3.7
  4. Starting 10 threads
  5. mytest: Laying out IO file (1 file / 2048MiB)
  6. Jobs: 10 (f=10): [r(10)][100.0%][r=126MiB/s,w=0KiB/s][r=8045,w=0 IOPS][eta 00m:00s]
  7. mytest: (groupid=0, jobs=1): err= 0: pid=24182: Mon Jul 13 15:57:05 2020
  8. read: IOPS=824, BW=12.9MiB/s (13.5MB/s)(773MiB/60046msec)
  9. clat (usec): min=201, max=46687, avg=1208.29, stdev=1106.39
  10. lat (usec): min=201, max=46691, avg=1208.64, stdev=1106.52
  11. clat percentiles (usec):
  12. | 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
  13. | 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
  14. | 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1860], 95.00th=[ 2409],
  15. | 99.00th=[ 4490], 99.50th=[ 6194], 99.90th=[13304], 99.95th=[19268],
  16. | 99.99th=[42730]
  17. bw ( KiB/s): min=10187, max=14368, per=10.06%, avg=13202.06, stdev=740.90, samples=119
  18. iops : min= 636, max= 898, avg=825.11, stdev=46.33, samples=119
  19. lat (usec) : 250=0.12%, 500=6.43%, 750=17.22%, 1000=24.66%
  20. lat (msec) : 2=43.50%, 4=6.76%, 10=1.10%, 20=0.17%, 50=0.04%
  21. cpu : usr=0.37%, sys=9.47%, ctx=49126, majf=0, minf=4
  22. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  23. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  24. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25. issued rwts: total=49503,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  26. latency : target=0, window=0, percentile=100.00%, depth=1
  27. mytest: (groupid=0, jobs=1): err= 0: pid=24183: Mon Jul 13 15:57:05 2020
  28. read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(772MiB/60001msec)
  29. clat (usec): min=193, max=54554, avg=1210.28, stdev=1134.88
  30. lat (usec): min=193, max=54555, avg=1210.66, stdev=1135.24
  31. clat percentiles (usec):
  32. | 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 701],
  33. | 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
  34. | 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
  35. | 99.00th=[ 4490], 99.50th=[ 6456], 99.90th=[15795], 99.95th=[20579],
  36. | 99.99th=[36963]
  37. bw ( KiB/s): min= 9472, max=14592, per=10.03%, avg=13169.25, stdev=801.80, samples=119
  38. iops : min= 592, max= 912, avg=823.01, stdev=50.12, samples=119
  39. lat (usec) : 250=0.14%, 500=6.37%, 750=17.55%, 1000=24.72%
  40. lat (msec) : 2=42.94%, 4=7.02%, 10=1.03%, 20=0.19%, 50=0.05%
  41. lat (msec) : 100=0.01%
  42. cpu : usr=0.41%, sys=9.43%, ctx=48992, majf=0, minf=4
  43. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  44. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  45. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  46. issued rwts: total=49380,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  47. latency : target=0, window=0, percentile=100.00%, depth=1
  48. mytest: (groupid=0, jobs=1): err= 0: pid=24184: Mon Jul 13 15:57:05 2020
  49. read: IOPS=825, BW=12.9MiB/s (13.5MB/s)(774MiB/60001msec)
  50. clat (usec): min=195, max=72242, avg=1206.03, stdev=1143.48
  51. lat (usec): min=195, max=72242, avg=1206.40, stdev=1143.62
  52. clat percentiles (usec):
  53. | 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 701],
  54. | 30.00th=[ 807], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
  55. | 70.00th=[ 1270], 80.00th=[ 1467], 90.00th=[ 1860], 95.00th=[ 2376],
  56. | 99.00th=[ 4490], 99.50th=[ 6652], 99.90th=[14746], 99.95th=[18220],
  57. | 99.99th=[39584]
  58. bw ( KiB/s): min= 9701, max=14368, per=10.07%, avg=13211.33, stdev=803.55, samples=120
  59. iops : min= 606, max= 898, avg=825.67, stdev=50.24, samples=120
  60. lat (usec) : 250=0.13%, 500=6.57%, 750=17.56%, 1000=24.54%
  61. lat (msec) : 2=43.13%, 4=6.77%, 10=1.08%, 20=0.20%, 50=0.04%
  62. lat (msec) : 100=0.01%
  63. cpu : usr=0.36%, sys=9.48%, ctx=49221, majf=0, minf=5
  64. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  65. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  66. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  67. issued rwts: total=49558,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  68. latency : target=0, window=0, percentile=100.00%, depth=1
  69. mytest: (groupid=0, jobs=1): err= 0: pid=24185: Mon Jul 13 15:57:05 2020
  70. read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(771MiB/60001msec)
  71. clat (usec): min=205, max=45488, avg=1209.12, stdev=1078.62
  72. lat (usec): min=205, max=45488, avg=1209.48, stdev=1078.74
  73. clat percentiles (usec):
  74. | 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
  75. | 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
  76. | 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
  77. | 99.00th=[ 4490], 99.50th=[ 6325], 99.90th=[14484], 99.95th=[19268],
  78. | 99.99th=[34341]
  79. bw ( KiB/s): min=10048, max=14496, per=10.03%, avg=13168.22, stdev=870.68, samples=119
  80. iops : min= 628, max= 906, avg=822.97, stdev=54.45, samples=119
  81. lat (usec) : 250=0.16%, 500=6.44%, 750=17.21%, 1000=24.70%
  82. lat (msec) : 2=43.22%, 4=6.97%, 10=1.08%, 20=0.17%, 50=0.05%
  83. cpu : usr=0.36%, sys=9.48%, ctx=48957, majf=0, minf=8
  84. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  85. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  86. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  87. issued rwts: total=49368,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  88. latency : target=0, window=0, percentile=100.00%, depth=1
  89. mytest: (groupid=0, jobs=1): err= 0: pid=24186: Mon Jul 13 15:57:05 2020
  90. read: IOPS=818, BW=12.8MiB/s (13.4MB/s)(767MiB/60001msec)
  91. clat (usec): min=195, max=111604, avg=1216.88, stdev=1179.19
  92. lat (usec): min=195, max=111604, avg=1217.29, stdev=1180.56
  93. clat percentiles (usec):
  94. | 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
  95. | 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
  96. | 70.00th=[ 1287], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
  97. | 99.00th=[ 4621], 99.50th=[ 6652], 99.90th=[13829], 99.95th=[18220],
  98. | 99.99th=[36963]
  99. bw ( KiB/s): min= 8637, max=14115, per=9.98%, avg=13099.41, stdev=767.93, samples=119
  100. iops : min= 539, max= 882, avg=818.66, stdev=48.03, samples=119
  101. lat (usec) : 250=0.10%, 500=6.46%, 750=16.93%, 1000=24.45%
  102. lat (msec) : 2=43.82%, 4=6.82%, 10=1.18%, 20=0.20%, 50=0.03%
  103. lat (msec) : 250=0.01%
  104. cpu : usr=0.40%, sys=9.45%, ctx=48738, majf=0, minf=4
  105. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  106. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  107. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  108. issued rwts: total=49111,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  109. latency : target=0, window=0, percentile=100.00%, depth=1
  110. mytest: (groupid=0, jobs=1): err= 0: pid=24187: Mon Jul 13 15:57:05 2020
  111. read: IOPS=822, BW=12.8MiB/s (13.5MB/s)(771MiB/60001msec)
  112. clat (usec): min=187, max=57617, avg=1211.33, stdev=1096.79
  113. lat (usec): min=187, max=57618, avg=1211.67, stdev=1096.91
  114. clat percentiles (usec):
  115. | 1.00th=[ 330], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
  116. | 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
  117. | 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2376],
  118. | 99.00th=[ 4424], 99.50th=[ 6194], 99.90th=[14353], 99.95th=[18744],
  119. | 99.99th=[40109]
  120. bw ( KiB/s): min= 9952, max=14432, per=10.03%, avg=13163.26, stdev=847.60, samples=119
  121. iops : min= 622, max= 902, avg=822.66, stdev=52.98, samples=119
  122. lat (usec) : 250=0.13%, 500=6.30%, 750=17.08%, 1000=24.41%
  123. lat (msec) : 2=43.95%, 4=6.82%, 10=1.10%, 20=0.18%, 50=0.04%
  124. lat (msec) : 100=0.01%
  125. cpu : usr=0.36%, sys=9.48%, ctx=48971, majf=0, minf=5
  126. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  127. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  128. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  129. issued rwts: total=49340,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  130. latency : target=0, window=0, percentile=100.00%, depth=1
  131. mytest: (groupid=0, jobs=1): err= 0: pid=24188: Mon Jul 13 15:57:05 2020
  132. read: IOPS=816, BW=12.8MiB/s (13.4MB/s)(766MiB/60001msec)
  133. clat (usec): min=193, max=47040, avg=1219.79, stdev=1099.57
  134. lat (usec): min=193, max=47040, avg=1220.16, stdev=1099.84
  135. clat percentiles (usec):
  136. | 1.00th=[ 330], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
  137. | 30.00th=[ 824], 40.00th=[ 922], 50.00th=[ 1029], 60.00th=[ 1139],
  138. | 70.00th=[ 1287], 80.00th=[ 1500], 90.00th=[ 1893], 95.00th=[ 2409],
  139. | 99.00th=[ 4621], 99.50th=[ 6521], 99.90th=[15008], 99.95th=[18744],
  140. | 99.99th=[34341]
  141. bw ( KiB/s): min=10560, max=14432, per=9.95%, avg=13065.61, stdev=742.12, samples=119
  142. iops : min= 660, max= 902, avg=816.55, stdev=46.42, samples=119
  143. lat (usec) : 250=0.12%, 500=6.34%, 750=16.98%, 1000=23.95%
  144. lat (msec) : 2=44.20%, 4=7.03%, 10=1.16%, 20=0.19%, 50=0.04%
  145. cpu : usr=0.41%, sys=9.43%, ctx=48593, majf=0, minf=4
  146. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  147. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  148. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  149. issued rwts: total=48996,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  150. latency : target=0, window=0, percentile=100.00%, depth=1
  151. mytest: (groupid=0, jobs=1): err= 0: pid=24189: Mon Jul 13 15:57:05 2020
  152. read: IOPS=812, BW=12.7MiB/s (13.3MB/s)(762MiB/60001msec)
  153. clat (usec): min=209, max=65934, avg=1225.17, stdev=1171.39
  154. lat (usec): min=209, max=65935, avg=1225.52, stdev=1171.51
  155. clat percentiles (usec):
  156. | 1.00th=[ 334], 5.00th=[ 465], 10.00th=[ 578], 20.00th=[ 717],
  157. | 30.00th=[ 824], 40.00th=[ 922], 50.00th=[ 1029], 60.00th=[ 1139],
  158. | 70.00th=[ 1287], 80.00th=[ 1500], 90.00th=[ 1876], 95.00th=[ 2409],
  159. | 99.00th=[ 4621], 99.50th=[ 6456], 99.90th=[16909], 99.95th=[20579],
  160. | 99.99th=[35390]
  161. bw ( KiB/s): min= 9152, max=14464, per=9.91%, avg=13010.76, stdev=896.78, samples=119
  162. iops : min= 572, max= 904, avg=813.13, stdev=56.06, samples=119
  163. lat (usec) : 250=0.11%, 500=6.26%, 750=16.66%, 1000=24.56%
  164. lat (msec) : 2=44.10%, 4=6.90%, 10=1.16%, 20=0.19%, 50=0.06%
  165. lat (msec) : 100=0.01%
  166. cpu : usr=0.38%, sys=9.46%, ctx=48401, majf=0, minf=0
  167. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  168. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  169. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  170. issued rwts: total=48777,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  171. latency : target=0, window=0, percentile=100.00%, depth=1
  172. mytest: (groupid=0, jobs=1): err= 0: pid=24190: Mon Jul 13 15:57:05 2020
  173. read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(771MiB/60000msec)
  174. clat (usec): min=189, max=56124, avg=1210.99, stdev=1097.65
  175. lat (usec): min=189, max=56124, avg=1211.36, stdev=1097.82
  176. clat percentiles (usec):
  177. | 1.00th=[ 338], 5.00th=[ 469], 10.00th=[ 578], 20.00th=[ 709],
  178. | 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
  179. | 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
  180. | 99.00th=[ 4424], 99.50th=[ 6128], 99.90th=[14091], 99.95th=[17957],
  181. | 99.99th=[38011]
  182. bw ( KiB/s): min= 9856, max=14368, per=10.02%, avg=13158.12, stdev=712.98, samples=119
  183. iops : min= 616, max= 898, avg=822.32, stdev=44.57, samples=119
  184. lat (usec) : 250=0.11%, 500=6.16%, 750=17.34%, 1000=24.42%
  185. lat (msec) : 2=43.71%, 4=6.94%, 10=1.11%, 20=0.17%, 50=0.03%
  186. lat (msec) : 100=0.01%
  187. cpu : usr=0.42%, sys=9.42%, ctx=48989, majf=0, minf=4
  188. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  189. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  190. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  191. issued rwts: total=49347,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  192. latency : target=0, window=0, percentile=100.00%, depth=1
  193. mytest: (groupid=0, jobs=1): err= 0: pid=24191: Mon Jul 13 15:57:05 2020
  194. read: IOPS=819, BW=12.8MiB/s (13.4MB/s)(769MiB/60023msec)
  195. clat (usec): min=201, max=45774, avg=1214.86, stdev=1085.41
  196. lat (usec): min=201, max=45775, avg=1215.21, stdev=1085.53
  197. clat percentiles (usec):
  198. | 1.00th=[ 338], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
  199. | 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
  200. | 70.00th=[ 1287], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
  201. | 99.00th=[ 4621], 99.50th=[ 6587], 99.90th=[13960], 99.95th=[18220],
  202. | 99.99th=[32900]
  203. bw ( KiB/s): min=10624, max=14592, per=10.00%, avg=13128.82, stdev=717.79, samples=119
  204. iops : min= 664, max= 912, avg=820.50, stdev=44.88, samples=119
  205. lat (usec) : 250=0.14%, 500=6.34%, 750=17.37%, 1000=24.06%
  206. lat (msec) : 2=43.91%, 4=6.78%, 10=1.19%, 20=0.18%, 50=0.03%
  207. cpu : usr=0.37%, sys=9.46%, ctx=48840, majf=0, minf=4
  208. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  209. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  210. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  211. issued rwts: total=49210,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  212. latency : target=0, window=0, percentile=100.00%, depth=1
  213. Run status group 0 (all jobs):
  214. READ: bw=128MiB/s (134MB/s), 12.7MiB/s-12.9MiB/s (13.3MB/s-13.5MB/s), io=7697MiB (8071MB), run=60000-60046msec
  215. Disk stats (read/write):
  216. dm-2: ios=492162/9, merge=0/0, ticks=154072/0, in_queue=154081, util=99.44%, aggrios=492602/12, aggrmerge=0/3, aggrticks=153537/0, aggrin_queue=153117, aggrutil=99.32%
  217. sda: ios=492602/12, merge=0/3, ticks=153537/0, in_queue=153117, util=99.32%

说明:

filename=/home/data 测试文件名称,通常选择需要测试的盘的data目录。和dd命令中的of输出文件类似

direct=1 测试过程绕过机器自带的buffer。使测试结果更真实。

rw=randwrite 测试随机写的I/O

rw=randrw 测试随机写和读的I/O

bs=16k 单次io的块文件大小为16k

bsrange=512-2048 同上,提定数据块的大小范围

size=5g 本次的测试文件大小为5g,以每次4k的io进行测试。

numjobs=30 本次的测试线程为30.

runtime=1000 测试时间为1000秒,如果不写则一直将5g文件分4k每次写完为止。

ioengine=psync io引擎使用pync方式

rwmixwrite=30 在混合读写的模式下,写占30%

group_reporting 关于显示结果的,汇总每个进程的信息。

此外

lockmem=1g 只使用1g内存进行测试。

zero_buffers 用0初始化系统buffer。

nrfiles=8 每个进程生成文件的数量。

read 顺序读

write 顺序写

rw,readwrite 顺序混合读写

randwrite 随机写

randread 随机读

randrw 随机混合读写

io总的输入输出量

bw:带宽 KB/s

iops:每秒钟的IO数

runt:总运行时间

lat (msec):延迟(毫秒)

msec: 毫秒

usec: 微秒

顺序读:

fio -filename=/home/data-direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

  1. [root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G
  2. mytest: (g=0): rw=read, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
  3. ...
  4. fio-3.7
  5. Starting 2 threads
  6. Jobs: 1 (f=1): [_(1),R(1)][100.0%][r=94.7MiB/s,w=0KiB/s][r=6058,w=0 IOPS][eta 00m:00s]
  7. mytest: (groupid=0, jobs=2): err= 0: pid=24221: Mon Jul 13 16:08:41 2020
  8. read: IOPS=6576, BW=103MiB/s (108MB/s)(2048MiB/19929msec)
  9. clat (usec): min=129, max=46795, avg=297.05, stdev=329.58
  10. lat (usec): min=129, max=46795, avg=297.38, stdev=332.03
  11. clat percentiles (usec):
  12. | 1.00th=[ 151], 5.00th=[ 167], 10.00th=[ 184], 20.00th=[ 225],
  13. | 30.00th=[ 241], 40.00th=[ 253], 50.00th=[ 265], 60.00th=[ 277],
  14. | 70.00th=[ 293], 80.00th=[ 318], 90.00th=[ 363], 95.00th=[ 441],
  15. | 99.00th=[ 1106], 99.50th=[ 1696], 99.90th=[ 3490], 99.95th=[ 4948],
  16. | 99.99th=[11600]
  17. bw ( KiB/s): min=32447, max=66720, per=50.43%, avg=53065.45, stdev=6970.87, samples=77
  18. iops : min= 2027, max= 4170, avg=3316.53, stdev=435.75, samples=77
  19. lat (usec) : 250=37.02%, 500=59.44%, 750=1.87%, 1000=0.51%
  20. lat (msec) : 2=0.78%, 4=0.31%, 10=0.06%, 20=0.01%, 50=0.01%
  21. cpu : usr=0.40%, sys=28.06%, ctx=130128, majf=0, minf=17
  22. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  23. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  24. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25. issued rwts: total=131072,0,0,0 short=0,0,0,0 dropped=0,0,0,0
  26. latency : target=0, window=0, percentile=100.00%, depth=1
  27. Run status group 0 (all jobs):
  28. READ: bw=103MiB/s (108MB/s), 103MiB/s-103MiB/s (108MB/s-108MB/s), io=2048MiB (2147MB), run=19929-19929msec
  29. Disk stats (read/write):
  30. dm-2: ios=130899/0, merge=0/0, ticks=31550/0, in_queue=31551, util=93.69%, aggrios=131072/0, aggrmerge=0/0, aggrticks=31572/0, aggrin_queue=31551, aggrutil=93.55%
  31. sda: ios=131072/0, merge=0/0, ticks=31572/0, in_queue=31551, util=93.55%

随机写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

  1. [root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G
  2. mytest: (g=0): rw=randwrite, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
  3. ...
  4. fio-3.7
  5. Starting 2 threads
  6. Jobs: 2 (f=2): [w(2)][100.0%][r=0KiB/s,w=117MiB/s][r=0,w=7516 IOPS][eta 00m:00s]
  7. mytest: (groupid=0, jobs=2): err= 0: pid=24226: Mon Jul 13 16:09:40 2020
  8. write: IOPS=7061, BW=110MiB/s (116MB/s)(2048MiB/18562msec)
  9. clat (usec): min=140, max=23792, avg=278.42, stdev=262.60
  10. lat (usec): min=140, max=23792, avg=279.05, stdev=262.83
  11. clat percentiles (usec):
  12. | 1.00th=[ 167], 5.00th=[ 182], 10.00th=[ 194], 20.00th=[ 208],
  13. | 30.00th=[ 221], 40.00th=[ 233], 50.00th=[ 243], 60.00th=[ 255],
  14. | 70.00th=[ 273], 80.00th=[ 293], 90.00th=[ 347], 95.00th=[ 429],
  15. | 99.00th=[ 963], 99.50th=[ 1516], 99.90th=[ 3228], 99.95th=[ 4015],
  16. | 99.99th=[ 9765]
  17. bw ( KiB/s): min=29472, max=61376, per=50.00%, avg=56485.92, stdev=5261.11, samples=74
  18. iops : min= 1842, max= 3836, avg=3530.28, stdev=328.78, samples=74
  19. lat (usec) : 250=56.30%, 500=40.49%, 750=1.75%, 1000=0.50%
  20. lat (msec) : 2=0.64%, 4=0.26%, 10=0.04%, 20=0.01%, 50=0.01%
  21. cpu : usr=1.58%, sys=45.69%, ctx=126798, majf=0, minf=7
  22. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  23. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  24. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25. issued rwts: total=0,131072,0,0 short=0,0,0,0 dropped=0,0,0,0
  26. latency : target=0, window=0, percentile=100.00%, depth=1
  27. Run status group 0 (all jobs):
  28. WRITE: bw=110MiB/s (116MB/s), 110MiB/s-110MiB/s (116MB/s-116MB/s), io=2048MiB (2147MB), run=18562-18562msec
  29. Disk stats (read/write):
  30. dm-2: ios=0/129877, merge=0/0, ticks=0/31041, in_queue=31042, util=98.30%, aggrios=0/131072, aggrmerge=0/0, aggrticks=0/31051, aggrin_queue=30927, aggrutil=98.24%
  31. sda: ios=0/131072, merge=0/0, ticks=0/31051, in_queue=30927, util=98.24%

顺序写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

  1. [root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest?-size=1G
  2. mytest?-size=1G: (g=0): rw=write, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
  3. ...
  4. fio-3.7
  5. Starting 2 threads
  6. Jobs: 2 (f=2): [W(2)][100.0%][r=0KiB/s,w=121MiB/s][r=0,w=7761 IOPS][eta 00m:00s]
  7. mytest?-size=1G: (groupid=0, jobs=2): err= 0: pid=24258: Mon Jul 13 16:11:14 2020
  8. write: IOPS=7372, BW=115MiB/s (121MB/s)(4096MiB/35556msec)
  9. clat (usec): min=129, max=48018, avg=266.59, stdev=277.34
  10. lat (usec): min=130, max=48019, avg=267.94, stdev=277.54
  11. clat percentiles (usec):
  12. | 1.00th=[ 163], 5.00th=[ 176], 10.00th=[ 188], 20.00th=[ 202],
  13. | 30.00th=[ 215], 40.00th=[ 227], 50.00th=[ 237], 60.00th=[ 247],
  14. | 70.00th=[ 265], 80.00th=[ 285], 90.00th=[ 330], 95.00th=[ 396],
  15. | 99.00th=[ 840], 99.50th=[ 1336], 99.90th=[ 3163], 99.95th=[ 3884],
  16. | 99.99th=[ 8094]
  17. bw ( KiB/s): min=44608, max=64512, per=49.98%, avg=58957.11, stdev=4302.08, samples=141
  18. iops : min= 2788, max= 4032, avg=3684.77, stdev=268.93, samples=141
  19. lat (usec) : 250=61.91%, 500=35.58%, 750=1.33%, 1000=0.40%
  20. lat (msec) : 2=0.55%, 4=0.19%, 10=0.04%, 20=0.01%, 50=0.01%
  21. cpu : usr=1.55%, sys=45.64%, ctx=254608, majf=0, minf=7
  22. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  23. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  24. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25. issued rwts: total=0,262144,0,0 short=0,0,0,0 dropped=0,0,0,0
  26. latency : target=0, window=0, percentile=100.00%, depth=1
  27. Run status group 0 (all jobs):
  28. WRITE: bw=115MiB/s (121MB/s), 115MiB/s-115MiB/s (121MB/s-121MB/s), io=4096MiB (4295MB), run=35556-35556msec
  29. Disk stats (read/write):
  30. dm-2: ios=0/261005, merge=0/0, ticks=0/60176, in_queue=60183, util=98.71%, aggrios=0/262164, aggrmerge=0/1, aggrticks=0/59821, aggrin_queue=59487, aggrutil=98.66%
  31. sda: ios=0/262164, merge=0/1, ticks=0/59821, in_queue=59487, util=98.66%

混合随机读写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -ioscheduler=noop -size=1G

  1. [root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -ioscheduler=noop?-size=1G
  2. mytest: (g=0): rw=randrw, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
  3. ...
  4. fio-3.7
  5. Starting 2 threads
  6. fio: io scheduler is not tunable
  7. fio: io scheduler is not tunable
  8. Jobs: 1 (f=1): [_(1),m(1)][100.0%][r=34.1MiB/s,w=15.0MiB/s][r=2182,w=960 IOPS][eta 00m:00s]
  9. mytest: (groupid=0, jobs=2): err= 0: pid=24285: Mon Jul 13 16:12:28 2020
  10. read: IOPS=4060, BW=63.4MiB/s (66.5MB/s)(2867MiB/45191msec)
  11. clat (usec): min=164, max=28045, avg=374.30, stdev=361.74
  12. lat (usec): min=164, max=28045, avg=374.52, stdev=361.76
  13. clat percentiles (usec):
  14. | 1.00th=[ 221], 5.00th=[ 235], 10.00th=[ 245], 20.00th=[ 260],
  15. | 30.00th=[ 273], 40.00th=[ 281], 50.00th=[ 293], 60.00th=[ 306],
  16. | 70.00th=[ 326], 80.00th=[ 359], 90.00th=[ 433], 95.00th=[ 611],
  17. | 99.00th=[ 2311], 99.50th=[ 2507], 99.90th=[ 3195], 99.95th=[ 3556],
  18. | 99.99th=[ 5473]
  19. bw ( KiB/s): min=23744, max=36896, per=50.56%, avg=32845.08, stdev=2406.20, samples=178
  20. iops : min= 1484, max= 2306, avg=2052.70, stdev=150.43, samples=178
  21. write: IOPS=1740, BW=27.2MiB/s (28.5MB/s)(1229MiB/45191msec)
  22. clat (usec): min=135, max=5166, avg=252.94, stdev=164.78
  23. lat (usec): min=135, max=5167, avg=253.68, stdev=164.86
  24. clat percentiles (usec):
  25. | 1.00th=[ 155], 5.00th=[ 165], 10.00th=[ 176], 20.00th=[ 188],
  26. | 30.00th=[ 202], 40.00th=[ 217], 50.00th=[ 231], 60.00th=[ 245],
  27. | 70.00th=[ 262], 80.00th=[ 277], 90.00th=[ 310], 95.00th=[ 359],
  28. | 99.00th=[ 775], 99.50th=[ 1450], 99.90th=[ 2409], 99.95th=[ 3032],
  29. | 99.99th=[ 3654]
  30. bw ( KiB/s): min=10347, max=16320, per=50.57%, avg=14079.40, stdev=1082.83, samples=178
  31. iops : min= 646, max= 1020, avg=879.91, stdev=67.75, samples=178
  32. lat (usec) : 250=27.82%, 500=66.80%, 750=2.12%, 1000=0.50%
  33. lat (msec) : 2=1.31%, 4=1.43%, 10=0.02%, 20=0.01%, 50=0.01%
  34. cpu : usr=0.36%, sys=26.62%, ctx=260834, majf=0, minf=7
  35. IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  36. submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  37. complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  38. issued rwts: total=183498,78646,0,0 short=0,0,0,0 dropped=0,0,0,0
  39. latency : target=0, window=0, percentile=100.00%, depth=1
  40. Run status group 0 (all jobs):
  41. READ: bw=63.4MiB/s (66.5MB/s), 63.4MiB/s-63.4MiB/s (66.5MB/s-66.5MB/s), io=2867MiB (3006MB), run=45191-45191msec
  42. WRITE: bw=27.2MiB/s (28.5MB/s), 27.2MiB/s-27.2MiB/s (28.5MB/s-28.5MB/s), io=1229MiB (1289MB), run=45191-45191msec
  43. Disk stats (read/write):
  44. dm-2: ios=183412/78606, merge=0/0, ticks=62288/16692, in_queue=78981, util=97.46%, aggrios=183504/78655, aggrmerge=0/0, aggrticks=62260/16671, aggrin_queue=78887, aggrutil=97.39%
  45. sda: ios=183504/78655, merge=0/0, ticks=62260/16671, in_queue=78887, util=97.39%

【Linux】fio测试读写速度的更多相关文章

  1. Linux 如何测试 IO 性能(磁盘读写速度)

    这几天做MySQL性能测试,偌大一个公司,找几台性能测试机器都很纠结,终于协调到两台,IO的性能如何还不知道.数据库属于IO密集型的应用,所以还是先评估下Server的IO性能,看看是否能和线上的机器 ...

  2. linux使用FIO测试磁盘的iops 【转载】

     linux使用FIO测试磁盘的iops 2013-09-23 10:59:21 分类: LINUX FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括 ...

  3. linux上测试磁盘IO速度

    运维工作,经常要测试服务器硬件性能,以此来判断是否存在性能瓶颈. 下面介绍在linux上测试磁盘IO速度的工具: 1.hdparm CentOS中,安装的两种方法: 1) yum安装. # yum i ...

  4. linux下测试磁盘的读写IO速度-简易方法

    linux下测试磁盘的读写IO速度-简易方法 参考资料:https://blog.csdn.net/zqtsx/article/details/25487185 一:使用hdparm命令 这是一个是用 ...

  5. Cgroup blkio简介和测试(使用fio测试)

    Cgroup blkio简介和测试(使用fio测试) 因需要对docker镜像内的进程对磁盘读写的速度进行限制,研究了下Cgroup blkio,并使用fio对其iops/bps限速进行测试. Cgr ...

  6. Linux 下测试磁盘读写 I/O 速度的方法汇总

    在分布式异构存储系统中,我们经常会需要测量获取不同节点中硬盘/磁盘的读写 I/O 速度,下面是 Linux 系统下一些常用测试方法(之后不定期更新): 1.使用 hdparm 命令这是一个是用来获取A ...

  7. Kali linux渗透测试常用工具汇总1

    1.ProxyChains 简介:代理工具.支持HTTP/SOCKS4/SOCK5的代理服务器,允许TCP/DNS通过代理隧道. 应用场景:通过代理服务器上网. 配置:/etc/proxychains ...

  8. Kali linux渗透测试的艺术 思维导图

    Kali Linux是一个全面的渗透测试平台,其自带的高级工具可以用来识别.检测和利用目标网络中未被发现的漏洞.借助于Kali Linux,你可以根据已定义的业务目标和预定的测试计划,应用合适的测试方 ...

  9. 【Linux】测试环境如何搭建?

    [Linux]测试环境如何搭建? (该文档所在我的百度网盘位置: ) 通常面试会问到会不会搭建测试环境?到底啥是测试环境搭建呢,其实测试环境没有想像的那么高大上,弄个 tomcat,把测试的 war ...

随机推荐

  1. uni-app中封装统一请求函数

    封装统一请求函数有利于项目的维护 整体功能简单实用,但小编遇到一个巨坑,项目中在vue文件使用跳转方法,url参数输入 "/" 后工具提示的路径为 "/pages/log ...

  2. Linux下基于.NET5开发CAX应用

    <<.NET5下的三维应用程序开发>>一文中介绍了如何在.NET5下使用AnyCAD开发应用程序.相比.NET4.x,.NET5一大进步便是可以跨平台,即可以在Linux.Ma ...

  3. centos7安装Hive及其问题解决

    本地如何安装hive (安装hive之前需要安装hadoop并启动hadoop的相关集群,mysql数据库) hadoop集群是两台,一台作为master,两台作为slaver,mysql单独占用一台 ...

  4. Spring Cloud Alibaba基础教程-Nacos(一)

    2019快结束,也有很久没写博客了,今天我们来谈谈Nacos,如果对您有帮助,麻烦左上角点个关注 ,谢谢 ! 嘻嘻 今天先写第一篇 文章目录 为什么要使用Nacos Eureka 闭源 Nacos的优 ...

  5. rest framework Serializer fields

    串行领域 在表单类中的每个字段不仅负责验证数据,同时也为"清洁" - 它以标准化格式一致. - Django文档 串行字段手柄的原始值和内部数据类型之间的转换.他们还应对验证输入值 ...

  6. HCIP --- BGP实验

    实验拓扑: 要求: R1.R2是EBGP关系,R2.R4是IBGP关系,R4.R5是EBGP邻居关系 R1与R5的环回可以通信 1.配置IP地址 2.BGP承载与IGP之上,所以给AS 2 启用IGP ...

  7. 在Linux下面端口映射socat自动脚本

    这个sh脚本可以方面的端口映射,在使用本功能之前请确保socat已经放到了/usr/bin/socat #!/bin/bash cd `dirname $0` let listenport=`base ...

  8. [EF] - 动态创建模型:System.Reflection.Emit + Code First

    动态创建Entity Framework模型并且创建数据库 使用System.Reflection.Emit+Code First model创建以下的一个实体类和DbContext并且创建数据库: ...

  9. Redis基础篇(三)持久化:AOF日志

    Redis是内存数据库,但是一旦服务器宕机,内存中的数据将会全部丢失. 最简单的恢复方式是从后端数据库恢复,但这种方式有两个问题: 频繁访问数据库,会给数据库带来巨大的压力: 从数据库中读取相比从Re ...

  10. 敏捷史话(一):用一半的时间做两倍的事——Scrum之父Jeff Sutherland

    普通的人生大抵相似,传奇的人生各有各的传奇.Jeff就是这样的传奇人物,年近80的他从来没有"廉颇老矣尚能饭否"的英雄迟暮,不久前还精神矍铄地与好几百名中国学生进行线上交流,积极回 ...