IOPS (Input/Output Per Second)即每秒的輸入輸出量(或讀寫次數),是衡量磁盤性能的主要指標之一。IOPS是指單位時間內系統能處理的I/O請求數量,通常以每秒處理的I/O請求數量爲單位,I/O請求一般爲讀或寫數據操做請求。隨機讀寫頻繁的應用,如OLTP(Online Transaction Processing),IOPS是關鍵衡量指標。另外一個重要指標是數據吞吐量(Throughput),指單位時間內能夠成功傳輸的數據數量。對於大量順序讀寫的應用,如VOD(Video On Demand),則更關注吞吐量指標。 dom
傳統磁盤本質上一種機械裝置,如FC, SAS, SATA磁盤,轉速一般爲5400/7200/10K/15K rpm不等。影響磁盤的關鍵因素是磁盤服務時間,即磁盤完成一個I/O請求所花費的時間,它由尋道時間、旋轉延遲和數據傳輸時間三部分構成。 ide
尋道時間Tseek是指將讀寫磁頭移動至正確的磁道上所須要的時間。尋道時間越短,I/O操做越快,目前磁盤的平均尋道時間通常在3-15ms。旋轉延遲Trotation是指盤片旋轉將請求數據所在扇區移至讀寫磁頭下方所須要的時間。旋轉延遲取決於磁盤轉速,一般使用磁盤旋轉一週所需時間的1/2表示。好比,7200 rpm的磁盤平均旋轉延遲大約爲60*1000/7200/2 = 4.17ms,而轉速爲15000 rpm的磁盤其平均旋轉延遲約爲2ms。 工具
數據傳輸時間Ttransfer是指完成傳輸所請求的數據所須要的時間,它取決於數據傳輸率,其值等於數據大小除以數據傳輸率。目前IDE/ATA能達到133MB/s,SATA II可達到300MB/s的接口數據傳輸率,數據傳輸時間一般遠小於前兩部分時間。 性能
所以,理論上能夠計算出磁盤的最大IOPS,即IOPS = 1000 ms/ (Tseek + Troatation),忽略數據傳輸時間。假設磁盤平均物理尋道時間爲3ms, 磁盤轉速爲7200,10K,15K rpm,則磁盤IOPS理論最大值分別爲,IOPS = 1000 / (3 + 60000/7200/2) = 140 IOPS = 1000 / (3 + 60000/10000/2) = 167 IOPS = 1000 / (3 + 60000/15000/2) = 200 測試
固態硬盤SSD是一種電子裝置, 避免了傳統磁盤在尋道和旋轉上的時間花費,存儲單元尋址開銷大大下降,所以IOPS能夠很是高,可以達到數萬甚至數十萬。實際測量中,IOPS數值會受到不少因素的影響,包括I/O負載特徵(讀寫比例,順序和隨機,工做線程數,隊列深度,數據記錄大小)、系統配置、操做系統、磁盤驅動等等。所以對比測量磁盤IOPS時,必須在一樣的測試基準下進行,即使如何也會產生必定的隨機不肯定性。一般狀況下,IOPS可細分爲以下幾個指標:Toatal IOPS,混合讀寫和順序隨機I/O負載狀況下的磁盤IOPS,這個與實際I/O狀況最爲相符,大多數應用關注此指標。 操作系統
Random Read IOPS,100%隨機讀負載狀況下的IOPS。 Random Write IOPS,100%隨機寫負載狀況下的IOPS。 Sequential Read IOPS,100%順序負載讀狀況下的IOPS。 Sequential Write IOPS,100%順序寫負載狀況下的IOPS。 線程
IOPS的測試benchmark工具主要有Iometer, IoZone, FIO等,能夠綜合用於測試磁盤在不一樣情形下的IOPS。對於應用系統,須要首先肯定數據的負載特徵,而後選擇合理的IOPS指標進行測量和對比分析,據此選擇合適的存儲介質和軟件系統。下面的磁盤IOPS數據來自http://en.wikipedia.org/wiki/IOPS,給你們一個基本參考。orm
Device IOPS Interface Notes 接口
7200 隊列
RPM SATA drives
~90 IOPS SATA II
10k
RPM SATA drives, queue depth 1
~130 IOPS
SATA II
fio -readonly -name iops
-rw=randread -bs=512 -runtime=20 -iodepth 1 -filename /dev/sda -ioengine libaio -direct=1
10k RPM Serial Attached SCSI drives
~140 IOPS SAS
15k RPM Serial Attached SCSI drives
~180 IOPS SAS
10k
RPM SATA drives, queue depth 24
~290 IOPS
SATA II
fio -readonly -name iops -rw=randread -bs=512 -runtime=20 -iodepth 24 -filename /dev/sda -ioengine libaio -direct=1
Simple SLC SSD ~400 IOPS SATA II
Intel X25-M G2 (MLC; As of March 2010)
~8,600 IOPS
SATA II
Intel's data sheet claims 6,600/8,600
IOPS (80GB/160GB version) and 35,000 IOPS for random 4KB writes and reads, respectively.
Intel X25-E (SLC; As of March 2009)
~5,000 IOPS
SATA II
Intel's data sheet claims 3,300 IOPS and 35,000 IOPS for writes and
reads, respectively. 5,000 IOPS are measured for a mix. Intel X25-E G1 has around 3 times higher IOPS compared to the Intel X25-M G2.
OCZ Z-Drive e84, a PCI Express SLC Solid State Drive
16,000 IOPS
PCIe
Maximum read/write speed of 800/750 MB/s).
G.Skill Phoenix Pro et. al.
~20,000 IOPS
SATA III
SandForce-1200 based SSD drives with enhanced firmware, states up to
50,000 IOPS, but real-world
performance shows for all drives from different manufacturers ~25,000 IOPS for random read and ~15,000 IOPS for random write.
ioDrive, a PCI-Express card with Flash
140,000 Read
IOPS, 135,000
Write IOPS
PCIe
ioDrive Duo 250,000+ IOPS PCIe
DDRdrive X1, a May 2009 PCI Express based solid-state drive
300,000+ (512B
Random Read IOPS) and 200,000+ (512B Random Write IOPS)
PCIe
Texas Memory System RamSan-20 120,000+ Random Read/Write IOPS
PCIe
Inlude RAM cache and UltraCapacitor to preserve the memory non-volatile
Texas Memory System RamSan-630 Appliance
1,000,000+ Random Read/Write IOPS FC / InfiniBand
Violin Memory Appliance
1,000,000+
Random Read/Write IOPS Proprietary interconnect
ioDrive Octal (single PCI Express card)
1,000,000+
Random Read/Write IOPS
PCIe