- 论坛徽章:
- 0
|
经常听说硬盘的Misalignment,但是在我个人的实施案例中,即使是SqlServer或者Exchange环境,都很少给用户做LUN的Alignment。难道是客户的应用压力太小,所以后果没有体现?从找到的资料看,Misalignment会给CPU带来最大20%的性能负载。不知道大家有没有真正做过,并且对比过性能结果?
为什么会产生Misalignment?
一般的硬盘或存储阵列,定义的每个Track包含64个Sector,但Windows的第一个分区总是从第64个Sector开始的。SQlServer或者Exchange应用都是以4KB或8KB大小的块进行读写,这样在读写某些数据块的时候,就有可能跨越两个Track。硬盘跨越两个Track读写的性能会有30%左右的损失。
Alignment的目的就是使第一个分区从第Track1的Sector 0开始。如果存储的Track定义是128或更大的Sector,做了Alignment后,分区将从Track 0的第65个Sector开始。
用diskpar察看硬盘的StartingOffset。32256就是63个sector,32768就是64个sector。
C:\>diskpar -i 2
---- Drive 2 Geometry Infomation ----
Cylinders = 13056
TracksPerCylinder = 255
SectorsPerTrack = 63
BytesPerSector = 512
DiskSize = 107389255680 (Bytes) = 102414 (MB)
---- Drive Partition 0 Infomation ----
StatringOffset = 32256
PartitionLength = 107380998144
HiddenSectors = 63
PartitionNumber = 1
PartitionType = 7
用diskpart Alignment的过程
Procedure
To align Exchange I/O with storage track boundaries using Diskpart.exe
1. If the disk you are aligning is already blank (raw), proceed to Step 3. If the disk contains data, backup the disk before proceeding.
2. Delete all partitions on the disk.
3. Open a command prompt, and execute Diskpart.exe.
4. At the Diskpart command prompt, type List Disk and press Enter. If the disk you want to align does not appear in the list make sure that it exists and is accessible using the Disk Management snap-in.
5. At the Diskpart command prompt, type Select Disk X, where X is the number of the disk as shown in the output of the List Disk command. Diskpart should return a message that indicates that Disk X is the selected disk.
6. At the Diskpart command prompt, type Create Partition Primary Align=X, where X is either 32 or 64, depending on the recommendation from your storage vendor. If your storage vendor does not have any specific recommendations, it is recommended that you use 64.
7. At the Diskpart command prompt, type Assign Letter=. For example, to assign letter Z to the disk, type Assign Letter=Z.
8. Once the drive letter is assigned, type exit to exit out of the Diskpart utility.
9. Use the Disk Management snap-in or the Windows Format command to format the partition as an NTFS-formatted partition.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/73762/showart_1087245.html |
|