Performance comparison between 4k and 512e hard drives

 

Overview

Industry standard disk drives have been using a native 512 (512n) bytes sector size. This low-level format has served the industry well for many years. However, as hard drive capacities have increased, sector size has increasingly become a limiting design element in improving hard drive capacities and error correction efficiency. For example, comparing the sector size to the total capacity of earlier hard drives versus more recent ones, you can see that the sector resolution has become extremely small. The resolution of the sector (the ratio of sectors as a percentage of total storage) has become very fine and increasingly inefficient.

Capacity(512 native drives)

Total Sectors

Sector Resolution

20 MB

40,000

.001%

200 GB

400,000,000

.0000001%

 

Very fine resolution is good when managing small, discrete amounts of data .However,   applications common in modern computing systems manage data in large blocks, much larger in fact than the legacy 512-byte sector size.More important, the small 512-byte sector has consumed a smaller and smaller amount of space on the hard drive surface as areal densities have increased. This is a problem in the context of error correction and the risk of media defects. The data in a hard drive sector is consuming smaller areas, making error correction more challenging because media defects of the same size can damage a higher percentage of the total data payload and, therefore, require more error correction strength.

However, due to the increasing demand for larger capacities, the storage industry from January, 2011 introduced new advanced formats, which are 512-byte emulation (512e) and 4KB Native (4Kn).

What is Advanced Format?

Advanced Format is a new technology for increasing hard drive capacities while maintaining data integrity. Advanced Format drives incorporate several changes, including increasing the physical sector size from 512 bytes to a more efficient 4096 (4K) byte sector size. In order to ease the transition, current Advanced Format drives provide 512-byte emulation (512e) at the drive interface for backward compatibility with legacy applications.

Format

Logical Sector

Physical Sector

512n(native)

512

512

512e(emulated)

512

4096

4Kn(native)

4096

4096

 

This is how sector of a 4k Drive looks

Figure 1: Base view inside of 4096 byte sector


We can understand this as grouping of 8 blocks of 512 bytes and making it in on big block of 4096 bytes and feeding to the requirement of heavy data transfer from the drives in a single block request. With this we are getting a bigger error correction code for each block. By this we can ensure the better integrity and safety of the data residing in the sectors of drive.

 Compatibility of 4k drives with legacy applications and controller hardware (512e drives)

So the problem arises to us when we receive request of block size less than 4k. At that time the hard drive media will throw error as it can’t cater the request of variable block sizes lesser than 4096 bytes.To ease up the transition process, the 512e emulated version was rolled out for all the legacy applications and hardware. The interface is developed on the hard drive media itself which manages and controls the request size of both read and write transition. See Figure: 2

 

Figure 2: Emulation in 512e drives


Performance hit issues of using 512e drives

Reading from 512e drives

  1. When the host requests to read a single 512-byte logical block, the hard drive will actually read the entire 4K physical sector containing the requested 512 bytes into the disk cache.
  2. The 512-byte is extracted and sent to the host.

Figure: 3: Reading from 4k sector


Read Modify Write cycle

  1. The hard drive will first read the 4K physical sector containing the 512 bytes that are to be overwritten.
  2. Next, it will insert the 512 bytes of new data and write the entire 4K block of data back to the media. This process is called a “Read-Modify-Write”.

Figure 4: Read Modify Write on 4k sector


Note: During this process there can be the situations when we will be overlapping the partition boundaries and that will raise the issues regarding updating of the wrong blocks or misalignment.

System Under test for performance check between 4k drive and 512e drive

  • Drive 1:Segate HD, 1T, NL6, 7.2K, 2.5, 512 EMULATED(Raid 1)
  • Drive 2:Segate HD, 1T, NL6, 7.2K, 2.5, 4K NATIVE(Raid 1)
  • Server : DELL R730
  • Disk Subsystem Benchmarking tool : SQLIO
  • Data test size : 44 Gb
  • Memory : 20 Gb

The test was benchmarked for OLTP kind of workload on dell hardware. The memory was fully utilized and data is getting hit from hard drives which are supposed to get tested. In the figure we can see the comparison between the 512e drives with 4k drives.The result shown clearly tells the 4k drives perform better than 512e drives in both reading and writing block. In random writes we can see that there is difference of 100-150 IOPS at each block size of request between 4k and 512e drives. The performance difference observed was around 14%.The test was conducted for all kind of block size request i.e. from 1k to 512k.

Figure 5: IOPS penalty while using 512e drive over 4K drives

Earlier we compared the IOPS of two drives, now let’s see what happens when you request block size lesser than the physical sector size of the drive (i.e. 4K).I am using this comparison because the controllers or legacy system which use 512-byte size request can make read write at different sizes like 1k, 2k, 3k on 4096 sector size drive. The emulated drives (512e) caters this kind of request but I see a serious performance hit in both read and write. During writing nearly 50% dip in IOPS which is clearly visible and evaluated.

 Figure 6: IOPS penalty while requesting data or block size lesser than 4k on 512e drives

Benefit of shifting to 4K Drives

  1. First, by optimizing the overhead associated with each smaller sector, the drive uses less space to store the same amount of information resulting in a format efficiency improvement.
  2. The second benefit is that a larger and more powerful error correction code (ECC) can be utilized, providing better integrity of user data.

Description

512e byte sector

4096 byte sector

Gap , Sync, Address-Mark

15 byte

15 byte

User Data

512 byte

4096 byte

Error Correction Code

50 byte

100 byte

Total

577 byte

4211 byte

Efficiency

88.7%

97.3 %

 Conclusion

4k drive are out performing 512e drive on each of the counters. These drives provide double error correction code with efficiency up to 97% which is 10% more than that of 512e drives. The misalignment issues can be avoided in 4K drives which in turn gives better performance to the customers. The price of both 4k drives are $10 more only which comes with long term benefits for customer. Hence the 4k drives should be opted for any kind of OLTP workload.

Author :

Anupam Maheshwari