The continuous reading and writing of mechanical hard disk is very good, but the random reading and writing performance is poor. This is because the head moves to the correct track to take time, random Read and write, the head keeps moving, time is spent on the head seek, so performance is not high. Such as:
Random Read-write performance (IOPS) is the most important metric when storing small files (images) and OLTP database applications.
Learning it helps us to analyze the performance bottlenecks of storage systems.
Let's recognize the random read-write performance indicator--iops (number of input and output per second).
Disk Performance Metrics--iops
----------------------------------------------------------
IOPS (Input/output per Second) is the number of input/output (or read/write) per second and is one of the key metrics for disk performance. ioPS refers to the number of I/O requests that the system can process per unit of time, typically in the number of I/O requests processed every second, and I/O requests are usually read or write data operation requests.
Random Read and write applications, such as small file storage (image), OLTP database, mail server, attention to random read and write performance, IOPS is the key measure.
Sequential read and write applications, transmission of a large number of continuous data, such as TV station video editing, video on Demand VOD (Demand), pay attention to continuous reading and writing performance. Data throughput is a key metric.
IOPS and data throughput are available for different scenarios:
Read 10,000 1KB files, spents 10 seconds throught (throughput) =1mb/s, iops=1000 pursuit of IOPS
Read 1 10MB files, spents 0.2 seconds throught (throughput) =50mb/s, Iops=5 pursuit throughput
Disk Service time
--------------------------------------
A traditional disk is essentially a mechanical device, such as FC, SAS, SATA disks, which typically have speeds of 5400/7200/10k/15k rpm. The key factor affecting the disk is the disk service time, which is the time it takes the disk to complete an I/O request, which consists of the seek time, the rotational delay, and the data transfer time.
Seek TimeTseek refers to the time required to move a read-write head to the correct track. The shorter the seek time, the faster I/O operation, the average seek time of the disk is usually 3-15ms.
Rotation delayTrotation refers to the time it takes for the disc to rotate to move the sector of the requested data below the read-write head. The rotational delay depends on the disk speed, typically 1/2 of the time it takes to rotate the disk for a week. For example, 7200 RPM has an average rotational delay of approximately 60*1000/7200/2 = 4.17ms, while a disk with a rotational speed of 15000 rpm has an average rotation delay of 2ms.
Data transfer TimeTtransfer is the amount of time required to complete the transfer of the requested data, depending on the data transfer rate, which is equal to the size divided by the transfer rate. At present, the Ide/ata can achieve the 133mb/s,sata II can reach 300MB/S interface data transmission rate, the data transmission time is usually much smaller than the first two parts of consumption time. Simple calculation can be ignored.
The average physical seek time for common disks is:
7200 RPM average physical seek time of stat HDD is 9MS
10000 RPM average physical seek time of stat HDD is 6ms
15000 RPM average physical seek time for SAS HDD is 4ms
The rotation delay time for common hard drives is:
7200 RPM Disk average rotational delay is approximately 60*1000/7200/2 = 4.17ms
The average rotational latency of 10000 RPM is approximately 60*1000/10000/2 = 3ms,
15000 RPM's disk has an average rotational delay of about 60*1000/15000/2 = 2ms.
Theoretical calculation method of maximum ioPS
--------------------------------------
IOPS = ms/(seek time + rotation delay). Data transfer time can be ignored.
7200 RPM Disk IOPS = +/(9 + 4.17) = ioPS
10000 RPM Disk IOPS = $/(6+ 3) = 111 IOPS
15000 RPM Disk IOPS = +/(4 + 2) = 166 ioPS
Factors that affect testing
-----------------------------------------
In actual measurements, IOPS values are affected by a number of factors, including I/O load characteristics (read and write ratios, order and randomization, number of worker threads, queue depth, data record size), system configuration, operating system, disk drive, and so on. Therefore, when comparing the measurement of disk IOPS, it must be done under the same test benchmark, even if this results in some random uncertainty.
Queue Depth Description
NCQ, SCSI Tcq, PATA TCQ, and SATA TCQ Technical analysis
----------------------------------------
is a sort of command technology, one to feed the device more IO requests, so that the elevator algorithm and equipment have the opportunity to arrange the merger and internal parallel processing, improve overall efficiency.
SCSI TCQ Queue depth Support level 256
ATA TCQ Queue Depth supports level 32 (requires more than 8M cache)
The NCQ can support up to 32 levels of command depth, and NCQ can sort up to 32 command commands.
Most of the software is synchronous I/O software, that is, the program's one-time I/O to wait until the last I/O operation is completed, so that in the hard disk may have only one command, but also can not play the advantage of this technology, the queue depth of 1.
With the popularity of Intel's Hyper-Threading technology and the multi-tasking of the application environment, as well as the proliferation of asynchronous I/O software. This technology can be applied, and the increase in actual queue depth represents a performance improvement.
In the test, the queue depth of 1 is the main indicator, most of the time refer to 1. The actual runtime queue depth is generally no more than 4.
ioPS can be subdivided into the following metrics:
-----------------------------------------
Random Read IOPS with a data volume of n bytes and a queue depth of K
The amount of data is n bytes, and when the queue depth is K, the random write ioPS
Test benchmark tools for IOPS
------------------------------------------
The IOPS test benchmark tools are mainly Iometer, IoZone, FIO, etc., and can be combined to test the IOPS of a disk in different scenarios. For the application system, the load characteristics of the data need to be determined first, then the reasonable IOPS metrics are selected for measurement and comparative analysis, thus selecting the appropriate storage medium and software system.
Disk Performance Index--iops theory