MySQL的QP

 
show global status where Variable_name in('com_select','com_insert','com_delete','com_update'); 
等待10秒 
磁盘IOPS计算与测量 

IOPS 是指单位时间内系统能处理的I/O请求数量,一般以每秒处理的I/O请求数量为单位,I/O请求通常为读或写数据操作请求。随机读写频繁的应用,如OLTP,IOPS是关键衡量指标。 
数据吞吐量(Throughput),指单位时间内可以成功传输的数据数量。对于大量顺序读写的应用,如VOD(Video On Demand),则更关注吞吐量指标。 
磁盘完成一个I/O请求所花费的时间,它由寻道时间、旋转延迟和数据传输时间三部分构成。 
寻道时间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)

Some com­monly accepted aver­ages for random IO operations, calculated as 1/(seek + latency) = IOPS:

Device Type IOPS Interface Notes
7,200 rpm SATA drives HDD ~75-100 IOPS[2] SATA 3 Gbit/s  
10,000 rpm SATA drives HDD ~125-150 IOPS[2] SATA 3 Gbit/s  
10,000 rpm SAS drives HDD ~140 IOPS[2] SAS  
15,000 rpm SAS drives HDD ~175-210 IOPS[2] SAS  

Solid State Devices

Device Type IOPS Interface Notes
Simple SLC SSD SSD ~400 IOPS[citation needed] SATA 3 Gbit/s  
Intel X25-M G2(MLC) SSD ~8,600 IOPS[11] SATA 3 Gbit/s Intel's data sheet[12] claims 6,600/8,600 IOPS (80 GB/160 GB version) and 35,000 IOPS for random 4 KB writes and reads, respectively.
Intel X25-E(SLC) SSD ~5,000 IOPS[13] SATA 3 Gbit/s Intel's data sheet[14] 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.[15]
G.Skill Phoenix Pro SSD ~20,000 IOPS[16] SATA 3 Gbit/s SandForce-1200 based SSD drives with enhanced firmware, states up to 50,000 IOPS, but benchmarking shows for this particular drive ~25,000 IOPS for random read and ~15,000 IOPS for random write.[16]
OCZ Vertex 3 SSD Up to 60,000 IOPS[17] SATA 6 Gbit/s Random Write 4 KB (Aligned)
Corsair Force Series GT SSD Up to 85,000 IOPS[18] SATA 6 Gbit/s 240 GB Drive, 555 MB/s sequential read & 525 MB/s sequential write, Random Write 4 KB Test (Aligned)
OCZ Vertex 4 SSD Up to 120,000 IOPS[19] SATA 6 Gbit/s 256 GB Drive, 560 MB/s sequential read & 510 MB/s sequential write, Random Read 4 KB Test 90K IOPS, Random Write 4 KB Test 85K IOPS
Texas Memory Systems RamSan-20 SSD 120,000+ Random Read/Write IOPS[20] PCIe Includes RAM cache
Fusion-ioioDrive SSD 140,000 Read IOPS, 135,000 Write IOPS[21] PCIe  
Virident SystemstachIOn SSD 320,000 sustained READ IOPS using 4KB blocks and 200,000 sustained WRITE IOPS using 4KB blocks[22] PCIe  
OCZ RevoDrive 3 X2 SSD 200,000 Random Write 4K IOPS[23] PCIe  
Fusion-io ioDrive Duo SSD 250,000+ IOPS[24] PCIe  
Violin MemoryViolin 3200 SSD 250,000+ Random Read/Write IOPS[25] PCIe /FC/Infiniband/iSCSI Flash Memory Array
WHIPTAIL, ACCELA SSD 250,000/200,000+ Write/Read IOPS[26] Fibre Channel, iSCSI, Infiniband/SRP, NFS, CIFS Flash Based Storage Array
DDRdrive X1, SSD 300,000+ (512B Random Read IOPS) and 200,000+ (512B Random Write IOPS)[27][28][29][30] PCIe  
SolidFireSF3010/SF6010 SSD 250,000 4KB Read/Write IOPS[31] iSCSI Flash Based Storage Array (5RU)
Texas Memory Systems RamSan-720 Appliance SSD 500,000 Optimal Read, 250,000 Optimal Write 4KB IOPS[32] FC / InfiniBand  
OCZ Single SuperScale Z-Drive R4 PCI-Express SSD SSD Up to 500,000 IOPS[33] PCIe  
WHIPTAIL,INVICTA SSD 650,000/550,000+ Read/Write IOPS[34] Fibre Channel, iSCSI, Infiniband/SRP, NFS Flash Based Storage Array
Violin MemoryViolin 6000 3RU Flash Memory Array 1,000,000+ Random Read/Write IOPS[35] /FC/Infiniband/10Gb(iSCSI)/ PCIe  
Texas Memory Systems RamSan-630 Appliance SSD 1,000,000+ 4KB Random Read/Write IOPS[36] FC / InfiniBand  
Fusion-io ioDrive Octal (single PCI Express card) SSD 1,180,000+ Random Read/Write IOPS[37] PCIe  
OCZ 2x SuperScale Z-Drive R4 PCI-Express SSD SSD Up to 1,200,000 IOPS[33] PCIe  
Texas Memory Systems RamSan-70 SSD 1,200,000 Random Read/Write IOPS[38] PCIe Includes RAM cache
Kaminario K2 Flash/DRAM/Hybrid SSD Up to 1,200,000 IOPS SPC-1 IOPS with the K2-D (DRAM)[39][40] FC  
NetApp FAS6240 cluster Flash/Disk 1,261,145 SPECsfs2008 nfsv3 IOPs using disks with virtual storage tiering.[41] NFS, CIFS, FC, FCoE, iSCSI SPECsfs2008 is the latest version of the Standard Performance Evaluation Corporation benchmark suite measuring file server throughput and response time, providing a standardized method for comparing performance across different vendor platforms. http://www.spec.org/sfs2008/
Fusion-io ioDrive2 SSD Up to 9,608,000 IOPS[42] PCIe  


你可能感兴趣的:(NoSql)