免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1554 | 回复: 0
打印 上一主题 下一主题

Disk Alignment的理由和过程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-21 09:18 |只看该作者 |倒序浏览

经常听说硬盘的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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP