Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dziku86/51a69418f65cd243e1124ae85d3d99f0 to your computer and use it in GitHub Desktop.
Save dziku86/51a69418f65cd243e1124ae85d3d99f0 to your computer and use it in GitHub Desktop.
πŸš„ This is a simple utility to increase the NTFS performance by turning off some NTFS features that are not so used by now (or not so important).
rem execute as an Administrator
rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html
ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10)
rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames)
rem disable 8dot3 filenames
ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it.
fsutil behavior set disable8dot3 1
rem increase ntfs mtz size
fsutil behavior set mftzone 2
rem disable last access time on all files
fsutil behavior set disablelastaccess 1
echo now you can reboot
@dziku86
Copy link
Author

dziku86 commented Mar 6, 2024

Examining and Tuning Disk Performance
Article
09/11/2008
The NTFS file system is the recommended file system because of its advantages in terms of reliability and security and because it is required for large drive sizes. However, these advantages come with some overhead. You can modify some functionality to improve NTFS performance as follows:

Disable creation of short names. By default, NTFS generates the style of file name that consists of eight characters, followed by a period and a three-character extension for compatibility with MS-DOS and Microsoft Windows 3. x clients. If you are not supporting these types of clients, you can turn off this setting by changing the default value of the NtfsDisable8dot3NameCreation registry entry (in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Filesystem) to 1.

Disable last access update. By default NTFS updates the date and time stamp of the last access on directories whenever it traverses the directory. For a large NTFS volume, this update process can slow performance. To disable automatic updating, change the value of the NtfsDisableLastAccessUpdate registry entry (in HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Filesystem) to 1. If the entry is not already present in the registry, add it before setting the value.

Reserve appropriate space for the master file table. Add the NtfsMftZoneReservation entry to the registry as a REG_DWORD in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. When you add this entry to the registry, the system reserves space on the volume for the master file table. Reserving space in this manner allows the master file table to grow optimally. If your NTFS volumes generally contain relatively few files that are typically large, set value of this registry entry to 1 (the default). Typically you can use a value of 2 or 3 for moderate numbers of files, and 4 (the maximum) if your volumes tend to contain a relatively large number of files. However, be sure to test any settings greater than 2 because these higher values cause the system to reserve a much larger portion of the disk for the master file table.
caution-icon
Caution
Do not use a registry editor to edit the registry directly unless you have no alternative. The registry editors bypass the standard safeguards provided by administrative tools. These safeguards prevent you from entering conflicting settings or settings that are likely to degrade performance or damage your system. Editing the registry directly can have serious, unexpected consequences that can prevent the system from starting and require that you reinstall Windows 2000. To configure or customize Windows 2000, use the programs in Control Panel or Microsoft Management Console (MMC) whenever possible.

@dziku86
Copy link
Author

dziku86 commented Mar 6, 2024

Examining and Tuning Disk Performance
Article
09/11/2008
By default, Task Manager continuously measures data for process I/O operations that you can select and display on the Processes tab in Task Manager. In a multiprocessor environment, this data is shared by the processors on which the process runs. When a process that generates considerable disk and network I/O, such as a database service, runs on several processors, updating the shared measurements of process I/O and global I/O operations can slow the system. You can improve the performance of I/O-intensive operations on SMP systems if you configure the system to bypass the global I/O counters and Task Manager process I/O counters. To do so, add the CountOperations entry to the registry as a REG_DWORD in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\I/O System. (If the I/O System subkey is not present, add it before creating the entry.) Set the entry value to 0. When so configured, Task Manager no longer provides per-process I/O measurements. For more information about Task Manager, see Overview of Performance Monitoring in this book.

@dziku86
Copy link
Author

dziku86 commented Mar 6, 2024

Examining and Tuning Disk Performance
Article
09/11/2008
Windows 2000 has an internal structure called the master boot record (MBR) that limits the maximum number of hidden sectors to 63. (For more information about the master boot record, see Disk Concepts and Troubleshooting in this book.) This characteristic of the MBR causes the default starting sector for disks that report more than 63 sectors per track to be the 64th sector. As a result, when programs transfer data to or from disks that have more than 63 sectors per track, misalignment can occur at the track level, with allocations beginning at a sector other than the starting sector. This misalignment can defeat system optimizations of I/O operations designed to avoid crossing track boundaries.

Additional disk-design factors make proper alignment even more difficult to achieve. For example, track information reported by disks is not always accurate. In addition, many disks have different numbers of sectors on different tracks (as might be the case with the outer bands versus the inner bands). Diskpar.exe, a sample program on the Windows 2000 Resource Kit companion CD, shows how you can use Windows 2000 APIs to obtain and set partition information. By applying the same functions used in this tool, you can avoid performance loss due to disk misalignment on disks with large track sizes and alignment optimizations. For more information about using Diskpar.exe, see MicrosoftWindows 2000 Resource Kit Tools Help.

@dziku86
Copy link
Author

dziku86 commented Mar 6, 2024

Evaluating Memory and Cache Usage
Article
09/11/2008
For virtual-memory support, Windows 2000 creates one paging file called Pagefile.sys on the disk or volume on which the operating system is installed. The default size is equal to 1.5 times the amount of physical memory. A small paging file limits what can be stored and might exhaust your virtual memory for applications. If you are short on RAM, more paging occurs, which generates extra activity for your disks and slows response times for the system.

Because the size and location of paging files can affect your systems performance, you might want to modify them. Also, because maintaining multiple files on multiple physical drives can improve performance, you might want to add a paging file. Figure 28.2 shows the Virtual Memory dialog box, which you use to change your paging file settings. See Windows 2000 Professional Help for specific instructions.

Cc958277.fnec06(en-us,TechNet.10).gif

Figure 28.2 Virtual Memory Dialog Box

The following guidelines describe how to optimize the paging file.

Set the Same Initial and Maximum Size
Setting the paging files initial size and maximum size to the same value increases efficiency because the operating system does not need to expand the file during processing. Setting different values for initial and maximum size can contribute to disk fragmentation.

Expand the Default Size
Expanding the default size of the paging file can increase performance if applications are consuming virtual memory and the full capacity of the existing file is being used. To determine how large your paging file needs to be based on your system workload, monitor the Process (_Total)\Page File Bytes counter. This indicates, in bytes, how much of the paging file is being used.

You can also determine the appropriate size of a paging file by multiplying the Paging File% Usage Peak counter value by the size of Pagefile.sys. The % Usage Peak counter indicates how much of the paging file is being used. Consider expanding the page file whenever either this counter reaches 70 percent of the total size in bytes of all paging files or the Memory% Committed Bytes In Use counter reaches 85 percent, whichever occurs first.

A large paging file uses disk storage space, so do not create a large paging file on a disk that is very active (for example, one that services heavy application or network activity) or one that has limited space. Change the file size gradually and test performance until you find the optimal balance between paging file and disk space usage. The operating system requires a minimum of 5 MB of free space on a disk. For more information, see Examining and Tuning Disk Usage in this book.

Move the Paging File
If disk space on your boot volume is limited, you can achieve better performance by moving the paging file to another volume. However, you might want to leave a smaller paging file on the boot volume and maintain a larger file on different volume with more capacity for the sake of recoverability. Depending on how you have configured your systems startup and recovery options, the configuration might require that you maintain a paging file of a certain size on the boot volume. Therefore, make sure to consider your startup and recovery settings when planning to move the paging file. For more information about startup and recovery options such as writing debugging information, see Windows 2000 Help.

Use Multiple Disks
Although Windows 2000 supports a limit of 4,095 MB for each paging file, you can supply large amounts of virtual memory to applications by maintaining multiple paging files. Spreading paging files across multiple disk drives and controllers improves performance on most modern disk systems because multiple disks can process input/output (I/O) requests concurrently in a round-robin fashion.

A mirrored or striped volume is a good candidate for the placement of a paging file. Placing the paging file on its own logical partition can prevent file fragmentation. Creating multiple paging files on a single logical volume or partition does not improve performance.

If you find that page writing and disk writing or page reading and disk reading are equivalent on a logical disk, splitting the paging file onto separate volumes is helpful.

note-icon

Note

To see how the paging file is used during memory shortages, start the LeakyApp tool on the Windows 2000 Resource Kit companion CD, which simulates memory leaks for monitoring purposes. While running LeakyApp, monitor Paging File% Usage Peak and Process(_Total)\Page File Bytes. Log these counters to get an idea of the rate of growth of the paging file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment