File-level Defragmentation of Exchange 2013 Volumes

Friday, July 26, 2013
By default, Windows Server 2012 automatically runs a weekly drive optimization (file-level defragmentation) on all drives. It also automatically optimizes new drives when they are added.

Now that you can install Exchange 2013 on Windows Server 2012 should you disable this feature as part of your server builds?

The latest information I could find from Microsoft on this subject is from Nino Bilic (2004): Do we need to file-level defragment Exchange database drives? and Mike Lagase (2011): How fragmentation on incorrectly formatted NTFS volumes affects Exchange.

Nino writes,
"The bottom line really is - you do not HAVE to file-level defrag the Exchange database drives. Exchange reads and writes to it's databases in very random fashion. Large sequential reads and writes will see much more improvement from file system defrag than Exchange databases will. But if you really WANT to do it - I would do it the old-fashioned way: move the databases off to some other volume, file system defrag the drive and then move the databases back... Or at least make sure you have a good backup, dismount the databases and file-system defrag them.
Mike writes,
"Note that it is still not recommended to run disk defragmentation software on Exchange server volumes, but there are times where file level fragmentation can cause significant performance problems on a server merely by the way data is being written to the disk. If optimal and/or recommended settings are not used when creating the volumes, this file fragmentation issue can occur much quicker. The majority of Exchange files are in use so running any regular disk defragmentation programs on the server will not help with this situation. If necessary, the only way to resolve this is to take all Exchange resources offline to ensure none of the files are in use and then defragment the disk to make the files contiguous on the disk once again."
That's Mike's emphasis, not mine.

So, while it's not necessarily going to break anything if you defragment your disks, it's best practice NOT to do it.  Especially letting Windows Server 2012 do it automatically every Wednesday at midnight, as is the default.  Also consider other workloads that may be running at the same time, such as Exchange backups.

Note that this recommendation normally applies to all local disks on an Exchange server, not just the drives that contain mailbox databases and transaction logs.  That's because the SMTP queue and temporary files are written to the same drive where the Exchange 2013 binaries are installed, usually the C: drive unless you've manually moved them to a different drive.

The Exchange product group will be officially adding this guidance for Exchange 2013 server builds on Windows Server 2012 in the near future.

Here's how to turn automatic drive optimization off in Windows Server 2012:

  • Using File Explorer, view the properties of the C: drive or any other local drive.
  • On the Tools tab, click Optimize.
  • You will see that all local drives are being optimized automatically every week:
  • Click the Change Settings button.
  • Clear the check box to Run on a schedule, as shown below:
  • Click OK, Close, and OK to save the settings.
Disabling drive optimization in this way will disable optimization for all drives.  It does not disable your ability to manually run a disk optimization on any drive.

No comments:

Post a Comment

Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.