磁盘性能 -- IOPS 和 吞吐量 说明

一. Wikepedia上有关IOPS 的说明

链接如下:http://en.wikipedia.org/wiki/IOPS

IOPS(Input/OutputOperationsPer Second, pronounced i-ops) is a common performance measurement used tobenchmarkcomputer storagedevices likeharddisk drives(HDD),solid state drives(SSD), andstorage area networks(SAN). As with anybenchmark, IOPS numbers published by storage device manufacturers do notguarantee real-world application performance.

IOPS can bemeasured with applications such asIometer(originallydeveloped byIntel),as well asIOzoneandFIO[3]and isprimarily used withserversto find the best storageconfiguration.

The specificnumber of IOPS possible in any system configuration will vary greatly dependingupon the variables the tester enters into the program, including the balance ofread and write operations, the mix ofsequentialandrandomaccesspatterns, the number of workerthreadsand queue depth, as well asthe data block sizes.[1]Thereare other factors which can also affect the IOPS results including the systemsetup, storage drivers, OS background operations, etc. Also, when testing SSDsin particular, there are preconditioning considerations that must be taken intoaccount.[4]

1.1 Performance characteristics

The most commonperformance characteristics measured are sequential and random operations.

Random access compared tosequential access:

Sequential operations access locations on the storage device in acontiguous mannerand are generally associated withlarge data transfer sizes, e.g., 128KB.

Random operations access locations on the storage device in a non-contiguous mannerand are generally associated with small data transfer sizes, e.g., 4KB.

The most commonperformance characteristics are as follows:

Measurement

Description

Total IOPS

Total number of I/O operations per second (when performing a mix of read and write tests)

Random Read IOPS

Average number of random read I/O operations per second

Random Write IOPS

Average number of random write I/O operations per second

Sequential Read IOPS

Average number of sequential read I/O operations per second

Sequential Write IOPS

Average number of sequential write I/O operations per second

For HDDs and similar electromechanical storage devices, the random IOPS numbers are primarily dependent upon the storagedevice's randomseek time, whereas for SSDs and similar solid statestorage devices, the random IOPS numbers are primarily dependent upon thestorage device's internal controller and memory interface speeds.

On both types ofstorage devices the sequential IOPS numbers (especially when using a largeblock size) typically indicate the maximum sustained bandwidth that the storagedevice can handle.[1]

Often sequential IOPS arereported as a simpleMB/snumber asfollows:

IOPS*TransferSizeInBytes=BytesPerSec(withthe answer typically converted toMegabytesPerSec)

Some HDDs willimprove in performance as the number of outstanding IO's (i.e. queue depth)increases. This is usually the result of more advanced controller logic on thedrive performing command queuing and reordering commonly called eitherTagged Command Queuing(TCQ) orNative Command Queuing(NCQ).

MostcommoditySATAdriveseither cannot do this, or their implementation is so poor that no performancebenefit can be seen. Enterprise class SATA drives, such as theWestern Digital Raptorand SeagateBarracuda NL will improve by nearly 100% with deep queues.[5]High-endSCSIdrives morecommonly found in servers, generally show much greater improvement, withtheSeagateSavvio exceeding 400 IOPS—more thandoubling its performance.[citation needed]

While traditional HDDs have about the same IOPS for read and write operations,mostNAND flash-basedSSDs are much slower writingthan reading due to the inability to rewrite directly into a previously writtenlocation forcing a procedure calledgarbage collection.[6][7][8]This hascaused hardware test sites to start to do IOPS testing, providing independentlymeasured results.

Newerflash SSD drives such as the Intel X25-E have much higher IOPS than traditionalhard disk drives. In a test done by Xssist, using IOmeter, 4KB randomtransfers, 70/30 read/write ratio, queue depth 4, the IOPS delivered by theIntel X25-E 64GB G1 started around 10000 IOPs, and dropped sharply after8 minutes to 4000 IOPS, and continued to decrease gradually for the next 42minutes. IOPS vary between 3000 to 4000 from around the 50th minutes onwardsfor the rest of the 8+ hours test run.[9]Even with thedrop in random IOPS after the 50th minute, the X25-E still has much higher IOPScompared to traditional hard disk drives. Some SSDs, including theOCZRevoDrive 3 x2PCIe using theSandForcecontroller, have shown much higher sustainedwrite performance that more closely matches the read speed.[10]

1.2 示例

Device

Type

IOPS

Interface

Notes

7,200rpmSATAdrives

HDD

~75-100 IOPS[2]

SATA 3Gb/s

10,000 rpm SATA drives

HDD

~125-150 IOPS[2]

SATA 3 Gb/s

15,000 rpmSASdrives

HDD

~175-210 IOPS[2]

SAS

二. IOPS 说明

2.1 IOPS(Input/OutputPer Second)

IOPS即每秒的输入输出量(或读写次数),是衡量磁盘性能的主要指标之一。IOPS是指单位时间内系统能处理的I/O请求数量,一般以每秒处理的I/O请求数量为单位,I/O请求通常为读或写数据操作请求。随机读写频繁的应用,如OLTP(OnlineTransaction Processing),IOPS是关键衡量指标。

另一个重要指标是数据吞吐量(Throughput)指单位时间内可以成功传输的数据数量。对于大量顺序读写的应用,如VOD(Video On Demand),则更关注吞吐量指标。


传统磁盘本质上一种机械装置,如FC, SAS, SATA磁盘,转速通常为5400/7200/10K/15K rpm不等。影响磁盘的关键因素是磁盘服务时间,即磁盘完成一个I/O请求所花费的时间,它由寻道时间、旋转延迟和数据传输时间三部分构成。

(1)寻道时间

Tseek是指将读写磁头移动至正确的磁道上所需要的时间。寻道时间越短,I/O操作越快,目前磁盘的平均寻道时间一般在3-15ms。

(2)旋转延迟

Trotation是指盘片旋转将请求数据所在扇区移至读写磁头下方所需要的时间。旋转延迟取决于磁盘转速,通常使用磁盘旋转一周所需时间的1/2表示。比如,7200 rpm的磁盘平均旋转延迟大约为60*1000/7200/2 = 4.17ms,而转速为15000 rpm的磁盘其平均旋转延迟约为2ms。

(3)数据传输时间

Ttransfer是指完成传输所请求的数据所需要的时间,它取决于数据传输率,其值等于数据大小除以数据传输率。目前IDE/ATA能达到133MB/s(MBPS),SATA II可达到300MB/s的接口数据传输率,数据传输时间通常远小于前两部分时间。

IOPS(每秒IO次数) = 1s/(寻道时间+旋转延迟+数据传输时间)


因此,理论上可以计算出磁盘的最大IOPS,即IOPS = 1000ms/ (Tseek + Troatation),忽略数据传输时间。假设磁盘平均物理寻道时间为3ms, 磁盘转速为7200,10K,15Krpm,则磁盘IOPS理论最大值分别为:

IOPS = 1000 / (3 + 60000/7200/2) = 140
IOPS = 1000 / (3 + 60000/10000/2) = 167
IOPS = 1000 / (3 + 60000/15000/2) = 200

2.2 固态硬盘的IOPS

固态硬盘SSD是一种电子装置, 避免了传统磁盘在寻道和旋转上的时间花费,存储单元寻址开销大大降低,因此IOPS可以非常高,能够达到数万甚至数十万。实际测量中,IOPS数值会受到很多因素的影响,包括I/O负载特征(读写比例,顺序和随机,工作线程数,队列深度,数据记录大小)、系统配置、操作系统、磁盘驱动等等。因此对比测量磁盘IOPS时,必须在同样的测试基准下进行,即便如何也会产生一定的随机不确定性。

通常情况下,IOPS可细分为如下几个指标:

Toatal IOPS:混合读写和顺序随机I/O负载情况下的磁盘IOPS,这个与实际I/O情况最为相符,大多数应用关注此指标。

Random Read IOPS:100%随机读负载情况下的IOPS。

Random WriteIOPS:100%随机写负载情况下的IOPS。

Sequential ReadIOPS:100%顺序负载读情况下的IOPS。

Sequential WriteIOPS:100%顺序写负载情况下的IOPS。

三.ORION 工具说明

ORION (OracleI/O Calibration Tool)Oracle 公司推出的一个校准数据库的存储系统I/O性能的独立工具。有关该工具的说明,参考:

Oracle ORION IO 测试工具

http://blog.youkuaiyun.com/tianlesoftware/article/details/5965331

我们使用ORION 工具测试一下看看:

[root@qs-xe-dzora-pd software]# cat dave.lun

/dev/sdb1

[root@qs-xe-dzora-pd software]# ./orion_linux_x86-64 -run advanced -testname dave -num_disks 2

ORION: ORacle IO Numbers -- Version11.1.0.7.0

dave_20111026_2026

Test will take approximately 16 minutes

Larger caches may take longer

查看生成的结果:

[root@qs-xe-dzora-pd software]# ls dave*

dave_20111026_2026_iops.csv dave_20111026_2026_summary.txt dave.lun_20111026_2025_summary.txt

dave_20111026_2026_lat.csv dave_20111026_2026_trace.txt

dave_20111026_2026_mbps.csv dave.lun

[root@qs-xe-dzora-pd software]# cat dave_20111026_2026_summary.txt

ORION VERSION 11.1.0.7.0

Commandline:

-run advanced -testname dave -num_disks 2

This maps to this test:

Test: dave

Small IO size: 8 KB

Large IO size: 1024 KB

IO Types: Small Random IOs, Large RandomIOs

Simulated Array Type: CONCAT

Write: 0%

Cache Size: Not Entered

Duration for each Data Point: 60 seconds

Small Columns:, 0

Large Columns:, 0,1, 2, 3,4

Total Data Points: 15

Name: /dev/sdb1 Size: 449495069184

1 FILEs found.

Maximum Large MBPS=159.61 @ Small=0 andLarge=4

Maximum Small IOPS=534 @ Small=10 andLarge=0

Minimum Small Latency=4.97 @ Small=1 andLarge=0

这里显示的吞吐量是160MBPS. IOPS 为534.


整理自网络

-------------------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Blog: http://blog.youkuaiyun.com/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Email: tianlesoftware@gmail.com

Skype: tianlesoftware

-------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----

DBA1 群:62697716(满); DBA2 群:62697977(满)DBA3 群:62697850(满)

DBA 超级群:63306533(满); DBA4 群:83829929(满) DBA5群: 142216823(满)

DBA6 群:158654907(满) DBA7 群:69087192(满)DBA8 群:172855474

DBA 超级群2:151508914 DBA9群:102954821 聊天 群:40132017(满)

### 分析解读 FIO 测试报告中的 IOPS吞吐量延迟数据 #### **IOPS(每秒输入/输出操作数)** IOPS 是衡量存储系统处理随机读写能力的重要指标,尤其在评估数据库、虚拟化等应用场景的性能时尤为关键。FIO 测试报告中会显示平均 IOPS 以及不同时间段内的 IOPS 变化情况。 - 在随机读取测试中,若 IOPS 值稳定且随着队列深度(iodepth)增加而线性增长,则表明系统具备良好的并发处理能力。 - 如果 IOPS 提升趋于平缓甚至下降,则可能表示系统已达到其最大处理能力,存在瓶颈[^1]。 - 例如,在一次测试中,系统达到了约 5217 IOPS性能,表明其具备较强的随机读取能力[^3]。 #### **吞吐量(Bandwidth)** 吞吐量反映了单位时间内可以传输的数据总量,通常以 MB/s 或 KB/s 表示,适用于顺序读写场景。 - 吞吐量IOPS 不同,更关注于连续数据流的处理效率。例如,大文件拷贝或视频流服务更依赖高吞吐量- 在 FIO 报告中,可以通过观察“read:”或“write:”部分的 bandwidth 指标来获取当前吞吐性能-吞吐量未随块大小(bs)增大而提升,可能意味着底层硬件带宽受限,或者网络传输存在瓶颈[^4]。 #### **延迟(Latency)** 延迟是衡量单个 I/O 请求从发出到完成所需时间的关键指标,直接影响用户体验应用响应速度。 - FIO 输出的延迟信息包括最小值、最大值、平均值以及百分位数(如 99.99% 的请求延迟)。 - 在一次测试中,99.99% 的读取操作延迟控制在 5ms 以内,说明系统具备较低的延迟特性,适合对响应时间敏感的应用[^3]。 - 若发现大量长延迟事件,应结合系统监控工具分析是否由磁盘拥塞、CPU 过载或网络延迟引起[^1]。 #### **综合分析方法** 为了全面理解 FIO 测试结果,建议采用以下方式: - **绘制图表**:使用 `gnuplot` 或其他可视化工具生成 IOPS吞吐量延迟随时间变化的趋势图,有助于识别性能拐点异常波动。 - **比较实际值与预期值**:设定明确的性能目标,并将测试结果与之对比,找出差距所在。 - **多维度交叉验证**:结合 CPU 使用率、内存占用、磁盘利用率等系统资源指标,判断是否存在资源争用问题。例如,某次测试中 CPU 利用率较低但磁盘利用率达到 100%,说明磁盘为瓶颈[^3]。 --- ```ini # 示例 FIO job 文件配置 [random-read] rw=randread ioengine=libaio direct=1 iodepth=32 bs=4k size=2G runtime=90 group_reporting=1 ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值