What is Rotational Latency: Explanation and Examples
How It Works
Imagine a record player spinning a vinyl disc. If you want to play a specific song, you have to wait until the needle reaches the right spot on the disc. Similarly, in a hard disk drive, data is stored on spinning disks called platters. The read/write head stays in place while the disk spins beneath it.
Rotational latency is the time it takes for the disk to spin so that the correct data sector is under the read/write head. Since the disk spins continuously, the head often has to wait for the disk to rotate to the right position before it can read or write data.
This waiting time depends on the disk's rotation speed, usually measured in revolutions per minute (RPM). Faster spinning disks have lower rotational latency because the needed data comes under the head more quickly.
Example
This simple Python example calculates the average rotational latency for a hard drive given its RPM speed.
def average_rotational_latency(rpm: int) -> float: """Calculate average rotational latency in milliseconds.""" rotations_per_ms = rpm / 60000 # convert RPM to rotations per millisecond time_per_rotation = 1 / rotations_per_ms # time for one full rotation in ms average_latency = time_per_rotation / 2 # average wait is half a rotation return average_latency # Example for a 7200 RPM hard drive rpm_speed = 7200 latency = average_rotational_latency(rpm_speed) print(f"Average rotational latency for {rpm_speed} RPM: {latency:.2f} ms")
When to Use
Understanding rotational latency is important when evaluating hard drive performance, especially for tasks that require frequent random access to data, like loading programs or databases. Lower rotational latency means faster access to data, improving overall system responsiveness.
Rotational latency is mostly relevant for traditional spinning hard drives (HDDs). Solid-state drives (SSDs) do not have moving parts, so they have virtually no rotational latency, making them much faster for random data access.
When choosing storage for a computer or server, knowing the rotational latency helps decide between HDDs and SSDs or between different HDD speeds (e.g., 5400 vs 7200 RPM).
Key Points
- Rotational latency is the delay waiting for the disk to spin the correct data under the read/write head.
- It depends on the disk's rotation speed (RPM).
- Average rotational latency is half the time of one full disk rotation.
- It affects how quickly data can be accessed on spinning hard drives.
- SSDs have no rotational latency because they have no moving parts.