Disk Drive Performance Characteristics

3 4

The disk drive (a.k.a. the hard disk) is one of the fundamental components of the computer system. Amazingly enough, the mechanics of disk drives have not changed much in the last 20 years. Disk drives are much more reliable and faster than they originally were, but fundamentally, they are the same. From a performance standpoint, disk drives are still one of the most important hardware components to tune. Properly speaking, you can't really tune a disk drive; however, by knowing its performance characteristics and limitations and configuring your system with those limitations in mind, you are, in effect, tuning the I/O subsystem.

Disk Drive Construction

The data storage component of a disk drive is made up of a number of disk platters. These platters are coated with a material that stores data magnetically. Data is stored in tracks, which are similar to the tracks of a record (or CD, for those of you who don't remember records). Each track, in turn, is made up of a number of sectors. As you get farther from the center of the disk drive, each track contains more sectors. Figure 5-1 shows a typical disk platter.

Figure 5-1. Disk platter.

Instead of having just one platter, a disk drive is often made up of many disk platters stacked on top of each other, as shown in Figure 5-2. The data is read by means of a magnetic head. This head is used both to read data from and write data to the disk. Because there are many platters, there are also many disk heads. These heads are attached to an armature that moves in and out of the disk stack, much like the arm that holds the needle on a record player. The heads and armatures are all connected; as a result, all heads are over the same point on all platters at the same time. Because disks operate in this manner, it makes sense for all heads to read and write at the same time; thus, data is written to and read from all platters simultaneously. Because the set of tracks covered by the heads at any one time resembles a cylinder, we say that data is stored in cylinders, as shown in Figure 5-2.

Disk drives can be made up of as few as one disk platter or more than six platters. The density of the data on the platters and the number of platters determine the maximum storage capacity of a disk drive. Some lines of disk drives are almost identical, with the exception of the number of disk platters. A popular line of disk drives has a 9-gigabyte (GB) disk drive with three disk platters and an otherwise identical 18-GB disk drive with six disk platters.

Figure 5-2. Disk cylinders.

Disk Drive Characteristics

Now that you have an idea of what makes up a disk drive, let's see how it works. First you will learn about the rotational characteristics of the disk drive, and then you will learn how disk seeks fit into the performance characteristics of disk drives.

Rotational Latency

Many high-performance disk drives spin at 10,000 revolutions per minute (rpm). If a request for data caused the disk to have to rotate completely before it was able to read the data, this spin would take approximately 6 milliseconds (ms), or 0.006 seconds. A rotational speed of 10,000 rpm equates to 166.7 rotations per second. This, in turn, translates to 1/166.7 of a second, or 6 ms, per rotation.

For the disk heads to read a sector of data, that sector must be underneath the head. Because the disk drive is always rotating, the head simply waits for that sector to rotate to the position underneath it. The time it takes for the disk to rotate to where the data is under the head is called the rotational latency. The rotational latency can be as long as 6 ms (if the disk has to rotate completely), but on average, it is around 3 ms.

The rotational latency is added to the response time of a disk access. So, when you are choosing disk drives for your system, it is extremely important from a performance standpoint that you take into consideration the length of the disks' rotational latency. As you have just seen, for a 10,000-rpm disk drive, the rotational latency is around 3 ms. Older generation disk drives spin at 7,200 rpm. With this type of disk drive, one rotation takes 8.3 ms, and the average rotational latency is about 4.15 ms. This length of time might not seem like a lot, but it is 38 percent longer than that of the 10,000-rpm disk drive. As you will see later in this chapter, this amount of response time can add a lot to your I/O times.

Disk Seeks

When retrieving data, not only must the disk rotate under the heads that will read the data, but also the head must move to the track where the data resides. The disk armature moves in and out of the disk stack to move the heads to the cylinder that holds the desired data. The time it takes the head to move to where the requested data resides is called the seek time. Seek time and rotational latency are represented in Figure 5-3.

Figure 5-3. Rotational latency and seek time.

The time it takes for a seek to occur depends mainly on how far the disk heads need to move. When the disk drives are accessing data sequentially, the heads need to move only a small distance, which can occur quickly. When disk accesses are occurring all over the disk drive, the seek times can get quite long. In either case, by minimizing the seek time, you improve your system's performance.

Seek time and rotational latency both add to the time it takes for an I/O operation to occur, and thus they worsen the performance of a disk drive. Rotational latency is usually around 3 ms for 10,000-rpm disks. The seek time of the disk varies depending on the size and speed of the disk drive and the type of seek being performed.

Track-to-Track Seeks Track-to-track seek time is the time the heads take to move between adjacent tracks. This type of seek is used when performing sequential I/O operations. A typical 10,000-rpm, 9-GB disk drive has a track-to-track seek time of around 0.8 ms. As you can see, for disks with a track-to-track seek time of only 0.8 ms, the rotational latency of approximately 3 ms is the larger factor in the disk drive performance. If the I/O operations are submitted to the disk drive fast enough, the disk drive will be able to access adjacent tracks or even read or write an entire track at a time. However, this is not always the case. In some cases, the I/O operations are not requested fast enough, and a disk rotation occurs between each sequential access. Whether this happens typically depends on the design and the speed of the disk controller.

Average Seek Time The average seek time is the time the heads take on average to seek between random tracks on the disk. According to the specification sheet of an average 10,000-rpm disk drive, the seek time for such a disk is around 6 ms. Because almost all of the I/O operations that SQL Server generates are random, your disk drives will be performing a lot of random I/O.

The maximum seek time of this type of disk can be as long as 13 ms. The maximum seek occurs from the innermost track of the platter to the outermost track, or vice-versa. This is referred to as a full-disk seek. But normally, the seeks will not be full-disk seeks, especially if the disk drive is not full.

Disk Drive Specifications

In this section, you will see how fast a disk drive can perform various types of I/O operations. To make these calculations, you must have some information about the disk drive. Much of this information can be found by looking at the specifications of the disk drive that the disk drive manufacturer provides. The sample specifications in this chapter are for a 10,000-rpm, 9.1-GB disk drive. Other specifications for this typical type of disk drive are shown in Table 5-1.

Table 5-1. Disk drive specifications

SpecificationValueDescription
Disk capacity9.1 GBThe unformatted disk capacity
Rotational speed10,000 rpmHow fast the disk is spinning
Transfer rate40 MBpsThe speed of the SCSI bus
Average seek time5.2 ms (read) 6 ms (write) How long (on average) it takes to seek between tracks during random I/O operations
Track-to-track seek time 0.6 ms (read) 0.9 ms (write) How long it takes to seek between tracks during sequential I/O operations
Full-disk seek time12 ms (read) 13 ms (write)How long it takes to seek from the innermost sector to the outermost sector of the disk, or vice versa
Average latency2.99 msThe average rotational latency
Mean time between failures 1,000,000 hoursOn average, how long the disk lasts

As you will see, these types of specifications can help you determine the performance of the disk drive.

Disk Drive Performance

Several factors determine the amount of time it takes for an I/O operation to occur. These factors are as follows:

  • The seek time required (for the heads to move to the track that holds the data)
  • The rotational latency required (for the data to rotate under the heads)
  • The time required to electronically transfer the data from the disk drive to the disk controller

So the time it takes for an I/O operation to occur is the sum of the times needed to complete the steps described here plus the time added by the overhead incurred in the device driver and in the operating system. Remember, the total time for an I/O operation depends mainly on whether the operation in question is sequential or random. Sequential I/O performance depends on track-to-track seeks. Random I/O performance depends on the average seek time.

Sequential I/O

Sequential I/O consists of accessing adjacent data in disk drives. Because track-to-track seeks are much faster than random seeks, it is possible to achieve much higher throughput from a disk when performing sequential I/O. To get an idea of how fast sequential I/O can occur, let's look at an example.

It takes approximately 0.8 ms to seek between tracks on a typical disk drive, as mentioned earlier. If you add the seek time to the rotational latency of 2.99 ms, you can conclude that each I/O operation will take approximately 3.79 ms. This would theoretically allow us to perform 264 sequential I/O operations per second (because each second contains 264 intervals of 3.79 ms). But with sequential I/O, other factors come into play, such as the SCSI bus bandwidth's limit of 40 megabytes per second (MBps) and operating system components such as the file system and the device driver. That overhead factors into the maximum rate of sequential I/O that a drive can sustain, which is around 250 operations per second (depending on how big the operations are). As you will see in Chapter 6, if you run a disk drive at more than 85 percent of its I/O capacity, queuing will occur; thus, the maximum recommended I/O rate is 225 operations per second.

Random I/O

Random I/O occurs when the disk heads must read data from various parts of the disk. This random head movement results in reduced performance. Again, let's look at the sample disk we covered earlier. Now instead of taking approximately 0.8 ms to seek between adjacent tracks on the disk, the heads must seek random tracks on the disk. This random seeking takes approximately 6 ms (on average) to complete, which is 7.5 times longer than the track-to-track seeks. A typical random I/O operation requires approximately 6 ms (on average) for the heads to move to the track where the data is held and 2.99 ms in rotational latency, for a total of 8.99 ms, giving a theoretical maximum of 111 I/O operations per second (because each second contains 111 intervals of 8.99 ms). Thus, using the same rule that you saw earlier, if you run a disk drive at more than 85 percent of its capacity, queuing will occur. Therefore, the maximum recommended I/O rate is 94 I/O operations per second. If you follow a rule of thumb that takes into account overhead in the controller, you would want to drive these disk drives at no more than 85 I/O operations per second.

When a disk drive performs random I/O, a normal latency (the time it takes to perform individual I/O operations) is 8.99 ms. When a drive is accessed faster than it can handle, queuing will occur, and the latency will increase. This is shown in Figure 5-4. As you can see, the closer the number of operations per second gets to the disk's recommended maximum rate, the longer the latencies get.

click to view at full size.

Figure 5-4. I/O operations per second as a function of latency.

In fact, if you get to 100 percent, queuing will certainly occur and performance will degrade dramatically. As you will learn later in this book, SQL Server (like all other relational database management systems) is highly sensitive to I/O latencies. When I/O operations take excessive amounts of time to complete, the performance of SQL Server degrades, and problems such as blocking and deadlocks might occur. When a thread is waiting on an I/O operation, it might be holding locks. The longer the operation takes to complete, the longer the locks are held, thus causing these types of problems.

Solutions to the Disk Performance Limitation Problem

So how do we solve the problem of disk performance limitations? It is actually quite straightforward. By following these guidelines, you should be able to design an I/O subsystem that performs optimally:

  • Isolate sequential I/O operations. By isolating components that are sequential in nature on their own disk volume, you can maintain that sequential nature. The transaction log is an example of a sequentially accessed file. If you place more than one sequentially accessed file on the same disk volume, the I/O operations will become random because the disk must seek between the various sequential components.
  • Distribute random I/O operations. Because the I/O operations are random in nature, you can alleviate the load by adding disk drives. If you build a system with enough disk drives to handle the random I/O load, you should not experience any problems. How many disks to use and how to configure them will be addressed later in this chapter and in Chapter 6.


Microsoft SQL Server 2000 Administrator's Companion
Microsoft SQL Server 2000 Administrators Companion
ISBN: B001HC0RPI
EAN: N/A
Year: 2005
Pages: 264

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net