Friday, March 29, 2013

Using contig.exe to analyze and remove fragmentation

The split of files in fragments can have serious impact on the performance of the Notes client or the Domino server. So it is very important to control the framgentation of the installation directory of Notes Domino and the data directories. The on board defrag tool of Windows is often not much help, because it can only defrag the whole harddisk and it cannot generate a report to show which file are fragmented and which are not. But Microsoft provides a tool which can analyze single files, directories or whole directory trees. It is called contig.exe. Contig.exe can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx.

The download contains one file (contig.exe) which should be extracted to a directory contained in the Windows path for example "c:\windows\system32". To analyze the fragmentation of the notesinstall directory you can use the following command line:

contig -a -v -s "c:\Program Files (x86)\ibm\Notes" > c:\temp\analyze.txt

-a only make an anaylze and do not defrag the files.
-v Verbose
-s Recursive subdirectorys
">c:\temp\anaylze.txt" write the report in the specified file.

The report contains for every file a entry with the count of fragments and a summary at the end:


....
Processing c:\Program Files (x86)\ibm\Notes\nlnotes.exe:
Scanning file...

[Cluster] Runlength
  [0] 247

  [2140] 150
  [3400] 250 
File size: 2759272 bytes
c:\Program Files (x86)\ibm\Notes\nlnotes.exe is in 3 fragments
------------------------
Summary:
     Number of files processed   : 22382
     Average fragmentation       : 10 frags/file


When you want to really defrag this files then remove the -a option and run the command again.

Contig.exe allows the use of wildcards to select files for defragmentation. So when you want to defrag all your nsf's in the Domino Data directory you can use:

contig -s "c:\Program Files (x86)\ibm\Domino\data\*.nsf"

2 comments:

  1. There's a "frontend" for contig.exe which is build especially for defragmenting Domino Servers:
    http://dominodefrag.openntf.org/
    Unfortunately, it has become a bit bloated in my opinion, but it contains a lot of features :-)

    ReplyDelete
  2. Yes i know dominodefrag, but as you said it is a little bit to bloated. So i prefer to use contig.exe directly.

    ReplyDelete

ad