NetApp – LUN Aligning
Determining Alignment on NetApp LUNS
priv set diag lun show -m lun alignment show [lun-name]
priv set diag lun show -m lun alignment show /vol/volDBBackup/q0/bkDaily
/vol/volDBBackup/q0/bkDaily Multiprotocol type: windows_2008 Alignment: aligned Write alignment histogram percentage: 99, 0, 0, 0, 0, 0, 0, 0 Read alignment histogram percentage: 100, 0, 0, 0, 0, 0, 0, 0 Partial writes percentage: 0 Partial reads percentage: 0
In our case:
- We have a volume correctly “formatted” as a MS Windows 2008 Volume
- Based on the Alignment entry, we are Aligned
- The Write and Read Alignment histogram percentage has most of our non-zero entries on the left ; this indicates that data is being written and read during the initial cycles
- And, finally our partial writes and reads percentile are close to zero
Now how does this work? See the alignment line, that is determined from the amount of misaligned requests. Note that request can be made as well as from the OS as from applications like databases. The numbers in line after the histogram are divided in 8 equal percentages. Every number is the amount 12.5% aligned steps, from really aligned to not aligned at all. So the higher the number on the left, the better.
Sample of a MisAligned LUN:
/vol/volDBBackup/q0/weekly Multiprotocol type: windows_2008 Alignment: misaligned Write alignment histogram percentage: 4, 3, 4, 5, 5, 4, 4, 3 Read alignment histogram percentage: 6, 4, 5, 18, 11, 4, 3, 2 Partial writes percentage: 64 Partial reads percentage: 43
In conclusion, as a DBA you ‘re staying up late at night and during the day ‘ving Joshua Ladder’s fights and conversations with your Storage Engineers. Next in line are calls to OS, Database, and Application Vendors.
A bit like trying to make sense of it all …
You have read Jimmy May and Denny Lee’s published papers on “Disk Partition Alignment”. And, have taking a liking to Joe Chang’s Database & Storage poetries.
And, so now you ‘re wondering what to do.
Well like all problems worth your time, it depends:
- Understand your Application and read through everything the Vendor has placed in the Public Domain per I/O interaction
- Classify your Application – Is it doing straight through or batched writing
- How much pre-fetch is occurring
- If Database, are you really following best practice and have dedicated LUNS for Data, Log, Temporary, and Backup purpose
- Are your files pre-sized; and if not, do you have well orchestrated growth strategy
- Back to the purpose of the LUN, if SQL Server, is this the Active or Passive side of a Mirrored Pair
Addendum – 2013-04-02
For me the principal basis for quickly getting information out and broadly sharing is that you allow that information to be read and washed out in public.
Early today, received a comment via email that some of my reading about NetApp LUN Alignment is a bit wrong:
The part about the NetApp filer is wrong. The 8 figures in the histogram row are not about the percentage of overall misalignment, they are about which 512 Byte “sector” of a 4k wafl block got hit the most. Obviously you want to have 100% at the first figure, and all zeroes on the rest. Such a histogram would tell you that everything is aligned perfectly. If you have the highest value on the 7th figure (or 6th? cant remember of the top of my head) its probably a misaligned XP or windows 2003 system accessing the LUN. if you have spikes on the 1st and the 7th value, then the LUN is probably a vmware datastore, with some aligned and some misaligned VMs.
And, so here I am trying to properly credit the commenter and see if there is new information on the Net along same lines.
And, as always Google brought us joy.
LUN (mis) alignment:
2011-07-14 06:47 AM – edited 2015-12-18 01:25 AM
priv set -q advanced; lun show -v
priv set -q advanced; lun show -v
On this new Filer, returned to running “lun alignment show”:
priv set advanced lun alignment show
priv set advanced lun alignment show -m
- The “partial writes percentage” and “partial reads percentage” numbers returned from “lun alignment show” is congruent with the summative data from “lun show -v”; specifically from “Alignment entry” –> misaligned /aligned.
- In our case, the two LUNS that indicate “misaligned” are the luns dedicated to SQL Server database logs.
On the Windows Host, to determine the “bytes per cluster” for a logical drive, issue:
fsutil fsinfo ntfsinfo [logical-drive]:
-- get bytes per cluster for logical drive L: fsutil fsinfo ntfsinfo L:
Again for Microsoft OS, you want to see “Bytes per cluster” coming in as 65536.
On the Windows Host, to determine the Partition “StartingOffset” for a logical drive, issue:
wmic partition get BlockSize, StartingOffset, Name
Based on NetApp Published guidance, this number can be one any of 3 numbers depending on the Version of Windows and the Disk Format Style:
How to diagnose misaligned I/O on Windows hosts
- Windows (MBR): This number should be 32256, 31.5kb offset is used when the LUN is created with the Windows LUN type (31.5 * 1024 = 32256).
- Windows (GPT): This number should be either 33,571,840B (32MB+17KB if LUN is <16GB) or 134,235,136 (128MB + 17KB if LUN >=16GB).
- Windows (2000): This number should be 65535 bytes for LUNs smaller than 4GB or 1048576 bytes for LUNs that are 4GB or larger.
Our Starting Offset is 1048576 and so it matches what we should per the NetApp KB listed above.
Addendum – 2013-05-16
Here is mostly the same information, but looked at with more understanding.
It is a silly thing, but like Snoop said:
… You don’t think of all of that, until you talk about all of that
- Lun Aligning
- New VDMK Misalignment Detection Tools in dataontap 725 and 802
- LUN (Mis)alignment
- How fragmentation on incorrectly formatted NTFS Volumes affects Exchange
- How to diagnose misaligned I/O on Windows hosts