1. 程式人生 > >磁碟效能--IOPS和吞吐量

磁碟效能--IOPS和吞吐量

一. Wikepedia上有關IOPS 的說明

IOPS (Input/Output OperationsPer Second, pronounced i-ops) is a common performance measurement used to benchmark computer storage devices like harddisk drives (HDD), solid state drives (SSD), and storage 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 as Iometer (originallydeveloped by Intel),as well as IOzone and FIO[3] and isprimarily used with servers to 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 of 

sequential and random accesspatterns, the number of worker threads and 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 a contiguous manner and are generally associated withlarge data transfer sizes, e.g., 128 KB.

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

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 random seek 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 simple MB/s number asfollows:

IOPS * TransferSizeInBytes = BytesPerSec (withthe answer typically converted to MegabytesPerSec

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 either Tagged Command Queuing (TCQ) or Native Command Queuing (NCQ).

Mostcommodity SATA driveseither cannot do this, or their implementation is so poor that no performancebenefit can be seen. Enterprise class SATA drives, such as the Western Digital Raptor and SeagateBarracuda NL will improve by nearly 100% with deep queues.[5] High-end SCSI drives morecommonly found in servers, generally show much greater improvement, withthe Seagate Savvio exceeding 400 IOPS—more thandoubling its performance.[citation needed

While traditional HDDs have about the same IOPS for read and write operations,most NAND flash-based SSDs are much slower writingthan reading due to the inability to rewrite directly into a previously writtenlocation forcing a procedure called garbage 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, 4 KB randomtransfers, 70/30 read/write ratio, queue depth 4, the IOPS delivered by theIntel X25-E 64 GB 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 the OCZ RevoDrive 3 x2PCIe using the SandForce controller, have shown much higher sustainedwrite performance that more closely matches the read speed.[10]

1.2 示例

Device

Type

IOPS

Interface

Notes

7,200 rpm SATA drives

HDD

~75-100 IOPS[2]

SATA 3 Gb/s

10,000 rpm SATA drives

HDD

~125-150 IOPS[2]

SATA 3 Gb/s

15,000 rpm SAS drives

HDD

~175-210 IOPS [2]

SAS

二. IOPS 說明

2.1 IOPS (Input/Output Per Second)

IOPS 即每秒的輸入輸出量(或讀寫次數),是衡量磁碟效能的主要指標之一。IOPS是指單位時間內系統能處理的I/O請求數量,一般以每秒處理的I/O請求數量為單位,I/O請求通常為讀或寫資料操作請求。例如,主機寫入一個最小的資料塊,也要經過“傳送寫入請求、寫入資料、收到寫入確認”等三個步驟,也就是3個儲存端訪問。

隨機讀寫頻繁的應用,如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

下面列一下不同的硬碟所能支撐的流量大小:

10 K rpm 15 K rpm ATA ———      ———      ——— 10M/s       13M/s       8M/s 每個物理硬碟能處理的IOPS是有限制的,如 10 K rpm 15 K rpm ATA ———      ———     ——— 100          150           50

IOPS的主要取決與陣列的演算法,cache命中率,以及磁碟個數。我們假定一個case,業務的iops是10000,讀cache命中率是30%,讀iops為60%,寫iops為40%,磁碟個數為120,那麼分別計算在raid5與raid10的情況下,每個磁碟的iops為多少。

raid5: 單塊盤的iops = (10000*(1-0.3)*0.6 + 4 * (10000*0.4))/120 = (4200 + 16000)/120 = 168 這裡的10000*(1-0.3)*0.6表示是讀的iops,比例是0.6,除掉cache命中,實際只有4200個iops 而4 * (10000*0.4) 表示寫的iops,因為每一個寫,在raid5中,實際發生了4個io,所以寫的iops為16000個 為了考慮raid5在寫操作的時候,那2個讀操作也可能發生命中,所以更精確的計算為: 單塊盤的iops = (10000*(1-0.3)*0.6 + 2 * (10000*0.4)*(1-0.3) + 2 * (10000*0.4))/120 = (4200 + 5600 + 8000)/120 = 148 計算出來單個盤的iops為148個,基本達到磁碟極限 raid10:  單塊盤的iops = (10000*(1-0.3)*0.6 + 2 * (10000*0.4))/120  =   (4200 + 8000)/120   = 102 可以看到,因為raid10對於一個寫操作,只發生2次io,所以,同樣的壓力,同樣的磁碟,每個盤的iops只有102個,還遠遠低於磁碟的極限iops。

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 效能的獨立工具。有關該工具的說明,參考:

我們使用ORION 工具測試一下看看:

[[email protected] software]# cat dave.lun

/dev/sdb1 

[[email protected] 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

檢視生成的結果:

[[email protected] 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

[[email protected] 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.

相關推薦

磁碟效能--IOPS吞吐量

一. Wikepedia上有關IOPS 的說明 IOPS (Input/Output OperationsPer Second, pronounced i-ops) is a common performance measurement used to benchmark computer stora

IOPS頻寬對儲存效能指標的影響

原文出處:http://975220.blog.51cto.com/965220/531449/ 說起儲存產品的評價,效能永遠是第一重要的問題。關於效能的各種指標實在五花八門:頻寬(Bandwidth)、IOPS、順序(Sequential)讀寫、隨機(Random)讀寫、持續吞吐(Susta

效能測試--系統吞吐量(TPS)、使用者併發量、效能測試概念公式

PS:下面是效能測試的主要概念和計算公式,記錄下: 一.系統吞度量要素:   一個系統的吞度量(承壓能力)與request對CPU的消耗、外部介面、IO等等緊密關聯。 單個reqeust 對CPU消耗越高,外部系統介面、IO影響速度越慢,系統吞吐能力越低,反之越高。 系統吞吐量幾個重要引數:QPS

磁碟io吞吐量

磁碟的 IOPS,也就是在一秒內,磁碟進行多少次 I/O 讀寫。 磁碟的吞吐量,也就是每秒磁碟 I/O 的流量,即磁碟寫入加上讀出的資料的大小。 IOPS 與吞吐量的關係每秒 I/O 吞吐量= IOPS* 平均 I/O SIZE。從公式可以看出: I/O SIZE 越大,IOPS 越高,那麼每秒 I/O

磁碟IOPS頻寬(throughput)

    SAN和NAS儲存一般都具備2個評價指標:IOPS和頻寬(throughput),兩個指標互相獨立又相互關聯。體現儲存系統性能的最主要指標是IOPS。 IOPS (Input/Output Per Second)即每秒的輸入輸出量(或讀寫次數),是衡量磁碟效能的主

IOPS頻寬對儲存效能的影響?

說 起儲存產品的評價,效能永遠是第一重要的問題。關於效能的各種指標實在五花八門:頻寬(Bandwidth)、IOPS、順序(Sequential)讀 寫、隨機(Random)讀寫、持續吞吐(Sustained Throughput)、突發處理能力(Burst I/O)等等

CSS動畫的效能分析瀏覽器GPU加速

此文已由作者袁申授權網易雲社群釋出。 歡迎訪問網易雲社群,瞭解更多網易技術產品運營經驗。 有數的資料大屏可以在一塊螢幕上展示若干張不同的圖表,以炫酷的方式展示各種業務資料。其中有些圖表使用CSS實現了餅圖輪播、地圖示記點閃爍等動畫,然而在一張大屏上同時顯示了許多張圖表時,持續的動畫效果有時會出現掉幀、卡頓的

磁碟(根資料放在不同分割槽)建立第一臺kvm虛擬機器、克隆虛擬機器

一,建立第一臺虛擬機器( 此步是在宿主機系統上進行的操作; 目的是作為克隆虛擬機器的模板): 1,虛擬機器磁碟規劃 磁碟A:大小260G 分割槽規劃,swap分割槽2048M,boot分割槽300M,根分割槽60G(lvm+xfs),資料分割槽(

AWS EBS Magnetic(standard)磁碟效能測試

背景 最近公司的一臺例項型別為m5.2xlarge(8個vCPU,32G的Memory)的機器磁碟效能不行,於是需要做個磁碟效能測試。這裡使用fio測試工具。 1.AWS磁碟型別簡介 AWS EC2 instance 目前EBS有5種類型,分別是gp2,io1,st1,sc1,standard.

磁碟可用空間佔用空間對不上的問題

新公司的測試機磁碟空間空餘很小,日誌很多,也很大,做個日誌壓縮指令碼,在夜裡4:30自動執行,第二天後發現磁碟空間又滿了,只好刪除沒用的日誌,清空空間,可詭異的是怎麼刪除沒用的檔案,空間還是佔用很大。如圖 用du 根目錄下,發現這些檔案加一塊也達不到佔用的空間大小。如圖 我也有遇見過此類問題,一般

Android之測量APP效能-分析除錯 APK(二)

分析和除錯預構建 APK Android Studio 3.0 允許您分析和除錯 APK,無需先從 Android Studio 專案構建這些 APK。 不過,您需要確保使用可除錯版本的 APK。 要開始除錯 APK,請在 Android Studio Welcome 歡迎螢幕中點選&nbs

MySQL效能分析優化-part 1

  MySQL效能優化 平時我們在使用MySQL的時候,怎麼評估系統的執行狀態,怎麼快速定位系統瓶頸,又如何快速解決問題呢? 本文總結了多年來MySQL優化的經驗,系統介紹MySQL優化的方法。 OS效能分析 使用top觀察top cpu/memory程序 使用mpstat觀察每

磁碟的型別介面

磁碟的介面型別 1.SATA磁碟與SATA介面 使用SATA口的磁碟又叫串列埠磁碟,當前pc機磁碟的主流,Seeial ATA採用序列連線方式,序列ATA匯流排使用嵌入式時鐘訊號,具備了而更強的糾錯能力,與以往下不過比最大的區別在於能對傳輸指令進行檢查,如果發現錯誤會自動矯正,這在很大程度上提高了資料傳輸

Linux 基礎知識 磁碟加密保護開機自動掛載

一、磁碟加密(luks加密) LUKS(Linux Unified Key Setup)為Linux硬碟分割槽加密提供了一種標準,它不僅能通用於不同的Linux發行版本,還支援多使用者/口令。因為它的加密金鑰獨立於口令,所以 如果口令失密,我們可以迅速改變口令而無需重新加密整個硬碟。通過提供一個

Linux效能監控除錯

作者:forest 來自:www.linuxstory.org 0 題記 對於每個網際網路研發人員來說,每天要監控和除錯 Linux 系統性能問題都是非常困難的工作。 為此,我們總結了非常有用的並且最常用的20個命令列系統監視工具。這些命令可以在所有版本的 Linux&nb

常用的虛擬機器效能監控故障處理工具

1. jps : 虛擬機器程序狀況工具          可以列出正在執行的虛擬機器程序,並顯示虛擬機器執行主類名稱,以及這些程序的本地虛擬機器唯一ID(LVMID)。          

【翻譯】效能測量技術提升

⚠️這個系列是自己瞎翻的,文法很醜,主要靠意會,跳著跳著撿重要的部分翻,翻錯了不負責,就這樣哈。 ⚠️基於3.4.3,Performance Measurement and Improvement Techniques,附原文。 目標  在處理影象的

Linux知識點總結之磁碟儲存 1.2 磁碟儲存結構分割槽

磁碟儲存結構和分割槽 ①主引導扇區的結構 ②磁碟引導基本過程 ③為什麼Linux作業系統只有四個分割槽 ④為什麼一個擴充套件分割槽可以劃分成多個邏輯分割槽 ⑤如何對磁碟分割槽 ⑥新增硬碟步驟 ⑦生產壞境分割槽建議 ⑧Linux為什麼要分割槽和格式化

Linux磁碟管理——BIOSUEFI

參考:BIOS and UEFI - CompTIA A+ 220-901 - 1.1 BIOS and UEFI As Fast As Possible 嚴格上來說BIOS和UEFI除了在搜尋bootable device時和磁碟有點關係,剩下就沒有任何關係了。BIOS和UEFI時獨立於OS的存在。

Linux01:磁碟的組成Linux磁碟分割槽

1.機械硬碟的組成 機械硬碟由碟片,機械手臂,磁頭,主軸馬達所組成。而現在普遍使用的固態硬碟(SSD)沒有這些機械元件,全部是由電子晶片及電路板組成。 固態硬碟(左)與機械硬碟(右)的區別  磁頭:磁頭是硬碟中對碟片進行讀寫工作的工具,是硬碟中最精密的部位之一。硬