Sunday, October 5, 2014

Defrag or Not? OS (virtual or physical) defrag attached to NetApp

The objective of disk defrag is to improve I/O performance by reducing seek latency on the disk drive.

In a single physical disk environment, such as the hard drive on your laptop, defrag can significantly improve performance. Reading a large file or document from disk is must faster when the file is stored on consecutive blocks. If the file is heavily fragmented, the actuator assembly (actuator, arms, heads, etc.) of the physical drive may have to "travel" some distance and wait for the disk platter to rotate into position before the read can continue.
In a SAN or Shared Storage Array, Defrag operation is not recommended at all.

The physical disk or spindle has been virtualized; your server disks are based on logical entities or "LUNs" that often have no direct relationship with the geometry of a particular physical spindle. We must therefore take into account many other factors affecting volume performance in light of defragmenting.

In fact, it will cause a lot of problems and will not improve performance.

Some of the risks are:

*Thin Provisioned VMs: If you defragment a Thin Provisioned VM, as file blocks are moved around, the VMDK consume much more disk space!
· Significant growth of snapshots!
· Duplicated data will changed and need to be "re-dedup"!
· Frequently accessed blocks are stored in cache, defrag accesses many otherwise unaccessed blocks.  Now the caching algorithm will be fooled into thinking that a dormant block of data is actually active, and store it in cache. The result is decrease of performance.
· ncrease in disk I/O traffic read and write!
  Storage vMotion: If a VM was being Storage vMotion’ed when a defrag operation was initiated, it would also impact the time to complete the operation since the defrag is changing blocks during the migration.
·NetApp WAFL optimizes placement of blocks anyway.  Obviously there is no single physical disk corresponding to your guest partition.
·Data corruption can happen.
·Defragmenting is Very I/O Intensive operation! This is worsened in a shared storage environment. It will affect the storage CPU. Additionally, if the volume you are attempting to defragment is a partition on a RAID group, other servers on that same RAID group will all suffer seriously degraded performance.
·Defragmenting Not Recommended for Auto-Tiered Storage: If the file system on the virtual disk were heavily fragmented, this could effectively have the undesirable effect of cause much of the virtual disks blocks to change tiers!
·Defragmenting Not Recommended for Replicated Volumes (snapmirorr): Each write associated with the defrag process will result in corresponding mirror writes to the destination or replication site. This can easily consume the bandwidth of the interconnect.
·Defragmenting Not Recommended for CDP Volumes: If you've implemented a CDP (Continuous Data Protection) system, you'll want to avoid defragmenting those volumes, as the procedure will quickly eat up your CDP journal space

Does Defragmenting Always Improve Performance On Logical Volumes?
NO. In fact, when multiple volumes are placed on partitions sharing a particular RAID group of spindles, defragmentation may actually degrade overall performance of the group of volumes.

Alternatives For Improving Performance:
If poor SAN I/O performance is causing you to study articles on disk defragmentation, you might want to consider looking for other ways to reduce I/O latency:

Use Intelligent Caching Storage Processors

Distribute the Work Load Across Storage Processors and Channels.
Choose Optimized RAID levels for performance-critical volumes.
 

 NetApp have a very good vSphere/NetApp interoperability WP in which they briefly discuss this topic. Quoting directly from the paper – “VMs stored on NetApp storage arrays should not use disk defragmentation utilities because the WAFL file system is designed to optimally place and access data at a level below the guest operating system (GOS) file system. If a software vendor advises you to run disk defragmentation utilities inside of a VM, contact the NetApp Global Support Center before initiating this activity.
VMWare engineer: “ if you run Windows defragmentation on the virtual server while also are using de-duplication on the storage, it can cause corruption of data on the virtual server and/or the VMDK".

No comments:

Post a Comment