|
Microsoft NT Server - Performance Tips and Tricks Written by:
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Last updated: 05/28/00 I have collected these tips on optimally configuring NT Server since August 1997. The tips come from a variety of sources including books, magazines, newsgroups, web sites, and personal experience. Almost every tip included, unless specifically noted, has been tested and provided a proven improvement to our servers and our client's servers. Unless otherwise noted, before using any tip mentioned, make sure you are running at least Service Pack 6a with NT4 before proceeding. These tips should also work for NT Workstation. NT Server Enterprise - but may have not been specifically tested. Windows 2000 is quite an upgade to NT4 and most of these tips are only for NT4. Do not apply the registry fixes to Windows 2000 unless you're preparing/understand the consequences. By and large, the registry tweaks for performance/memory are not necessary for Windows 2000. As they say, measure twice, cut once... Tip - Defragmentation NT does not provide a defragment utility like Windows 95 does. Microsoft used to say that fragmentation is not a problem on an NTFS drive. They do not say that anymore because it IS NOT TRUE. Any NT drive that has had more than one application loaded on it is fragmented. Every file access beyond the initial install causes fragmentation. From my experience, a basic server takes a fragmentation performance hit the SECOND DAY IT IS RUNNING. I am not kidding. Fragmentation is like a cold, the longer you wait to do something about it, the harder it is to get rid of. We use and recommend Executive Software's Diskeeper 3.0 Server/Workstation. It works very well, and will run in the background insuring the server's drives are kept at their optimal performance. If you are attempting to defragment a server that is heavily fragmented, DO NOT rely on the background defragmenter to resolve your fragmentation problem - it won't happen. In order to resolve the initial fragmentation problem, you will NEED to manually run Diskeeper repeatedly until your fragmentation level drops to a low level (if not completely eliminated). In order to successfully defragment a drive, you should insure that at least 20% of the drive's space is free. If not, you will need to manually run the defragmentation many times initially - with a slimmer chance of a completely fragment-free drive. I've had to in the past move files off of the drive temporarily just to bring the fragementation in line. Tip - L2 Cache If you have more than 256KB of L2 cache, Windows NT may not be using all of it. We've only found this tip needed for older dual-processor Pentium motherboards (Tyan Tomcat III or IV). Anything newer (Pentium II or better), Windows NT seems to determine the L2 cache amount just fine. 1. Run Regedt32.exe 2. Bring up the window HKEY_LOCAL_MACHINE (on the local machine) 3. Select System CurrentControlSet Control SessionManager MemoryManagement
On the right side of the window you will find SecondLevelDataCache. This defaults to 0, which is the correct value for 256KB of L2 cache. Double-click SecondLevelDataCache to bring up the DWORD Editor. Click the Decimal radio button, enter the amount of L2 cache you have, then click OK. Exit RegEdt32, and your machine should be a lot faster. If you don't know how much L2 cache you have, you may be able to find out during boot-up. Each brand of BIOS has its own display format, but look for "L2 Cache", "Secondary Cache", or something like that. The value should be 256, 512, or 1024. Tip - I/O Rate If your system is fairly I/O intensive, you may benefit from raising the I/O Page Lock Limit, which can increase the effective rate at which data is read from or written to the hard disks. First, benchmark your common tasks. See how long it takes to load and save large files, how long it takes to search a database or run a common program; just do your normal tasks, timing them to record how fast they are. Then follow these steps: 1. Run Regedt32.exe. 2. Bring up the window HKEY_LOCAL_MACHINE (on the local machine) 3. Select System CurrentControlSet Control SessionManager MemoryManagement 4. On the right half of the window, double-click IoPageLockLimit 5. Click the Decimal radio button
This value is the maximum bytes that can be locked for I/O operations. A value of 0 defaults to 512KB. Raise this value by 512KB increments (simply entering the number "512", "1024", etc.), then exit regedt32 and benchmark your system after each increment. When an increase does not give you a significant performance boost, go back and undo the last increment. Caution: There is a limit to this. I recommend you do not set this value (in bytes) beyond the number of MB of RAM times 128. That is, if you have 16 MB RAM, do not set IoPageLockLimit over 2048 bytes; for 32 MB RAM, do not exceed 4096 bytes, and so on. That's the safe method. You may be adventurous or impatient and want quick results. If so, try this: 1. Benchmark 2. Calculate your maximum IoPageLockLimit value (MB of RAM times 128) 3. Set IoPageLockLimit to 1/2 this value 4. Benchmark again
If you get little or no improvement, work down by 512 byte decrements till you note a drop in performance, then go back up 512 bytes. If you did see an improvement, continue with step 5. 5. Raise IoPageLockLimit to 3/4 maximum 6. Benchmark again
If you get little or no improvement in the third benchmark, work down in 512 byte decrements. If you do get improvement, work up from maximum. And if the first increase from shows little improvement, work down from . Unless you don't do much I/O, this should give you a significant boost in performance. Tip - What is Using Your Memory? To find out how much memory each application is using, the first thing to do is click Start, then go to Programs, Administrative Tools and Windows NT Diagnostics. Click the Memory tab and look at Physical Memory in the upper right hand section. This tells you how much memory you have and how much is available. Also note the section below this, Kernel Memory; this is what Windows NT itself is using. Then press CTRL-ALT-DEL and click the Task Manager button, then the Processes tab. This lists the existing processes. If it does not have columns titled Mem Usage and VM Size (Virtual Memory), go to the menu bar and click View, then Select Columns and check the boxes for Memory Usage and Virtual Memory Size. Now you can see just how much memory each process is currently using. Add the VM Size value and you have the amount of memory the process actually uses. If the Physical Memory is low (a few thousand or less), you definitely need more RAM. Incidentally, in the same Windows NT Diagnostics window, you will find Pagefile Space. If the Peak Use value is anywhere near the Total value, you should make a larger pagefile, or create another pagefile on another partition; a large single pagefile is generally faster than two small pagefiles. Memory Management: This is the most likely area to need tuning. Most of the value entries are maintained from Control Panel System Virtual Memory, but there are a couple you may tweak manually. Memory Management Value Entries Some of these entries may not appear in your Registry. If so, you can add them, but be sure you spell them EXACTLY as presented here, without changing the case of any character. ClearPageFileAtShutdown: When this is set to a Value Type of REG_DWORD and a value of 1, all data in the paging file will be cleared upon system shutdown. You must reboot for this change to take effect. The paging file will not be cleared on this reboot, but will clear on each subsequent one. DisablePagingExecutive: When set to zero, this allows Windows NT to page the kernel pools to the paging file; set it to one, and the kernel pool will stay in memory. If you have a large amount of unused memory, or if for some reason your paging file is slow, this might be of value. Disabling the Paging Executive may slow your system to a crawl, so if you are going to try changing this, pick a time when your system can be out of production for a while. IoPageLockLimit: This value is the maximum bytes of memory that can be locked for I/O operations. A value of 0 defaults to 512KB. Raising this value can give you a significant performance boost. The procedure is detailed in the article Memory Usage. LargeSystemCache: 0 tells the system to favor the processes working set, non-zero means to favor the system-cache working set. For most systems, your applications will run faster if this value is set to zero; if it is non-zero, your paging file may be over-active (if you have a noisy hard drive, check to see if LargeSystemCache is non-zero). Thus most Workstations should have this set to zero, and most Servers should have it set to one. PagedPoolQuota PagedPoolSize: Also Min, Max, and others, and all of these for NonPagedPool. "Pool" is all of the system memory. "Paged" means it can be paged, or written, to the disk. "NonPaged" means it can't be written to the disk. The values in the Registry are normally zero, which tells Windows NT to calculate default values relative to the amount of RAM on your computer. You should leave these alone because, since changing these values can cause Windows NT to miscalculate other resource allocations, incorrect values can cause Windows NT to malfunction, and possibly even cause file system corruption. A professional who knows what side-effects will occur may benefit from reducing the pool allocations (setting values larger than the defaults will have no effect), but I'm sure that very few people outside Microsoft know enough to safely tinker with this. But if you're interested in the details of the default calculations, see the Microsoft article Q126402. You can find Knowledge Base articles by going to www.microsoft.com, clicking Support in the menu bar, then clicking support online in the first paragraph. Click the radio button "Specific article ID number" then enter the article number. PagingFiles: Data about existing paging files (location and sizes) is stored here. You should use Control Panel / System / Performance to adjust your paging files, but this value can be handy if you get in trouble. For example, if your paging file is smaller than your physical memory or your system partition does not have enough free space to record a crash dump file, then if you get a bug check (the blue screen crash), your system may go into a continuous series of reboots. The Microsoft Knowledge Base article Q174630 details how to handle this. SecondLevelDataCache: This is the amount of L2 cache Windows NT will use. It defaults to 0, which is the correct value for 256KB of L2 cache. If it is set to 0, but you have more than 256KB cache, you should change it. 1. Double-click SecondLevelDataCache to bring up the DWORD Editor. 2. Click the Decimal radio button 3. Enter the amount of L2 cache you have, e.g., "512" for 512KB of cache. 4. Click OK.
This will probably give you a noticeable performance increase. Some people have reported no change, some say their performance more than doubled. SystemPages: Here you specify the number of page table entries available. The default is almost always sufficient, but if you install a PCI card with a very large amount of on-board memory (like a very sophisticated video card), and you cannot access all of the card's memory, this is probably where the solution will be. Contact the card's manufacturer for the correct value to enter. Tip - Page/swap file Swap file performance will improve if you follow these simple rules of thumb: - Create a swap file that is at least two times the amount of installed memory.
- Place your swap file on the fastest drive.
- If you are running a database server, place the swap file on a different drive than your database is stored on.
- Allocate the swap file as one contiguous chunk. i.e. defragment the drive you wish to store the swap file on BEFORE creating the swap file. To do this, go to Control Panel->System->Performance->Virtual Memory and set your current swap file to 0. This will delete the swap file. Then defragment your target swap file drive. Insure there is enough disk space to hold your new swap file. When complete, go back to the virtual memory setting and create your new swap file.
- Keep swap files and print queues on separate drives. Print queues also need large contiguous disk space for best performance.
- You only need one swap file per PHYSICAL drive! If you have a drive partitioned into two or more drives, you should only have one swap file.
Tip - Server Properties One seldom performed optimization is telling NT how to balance memory/network performance. Out of the box, NT Server is set to be optimized as a workstation!! Here's how to fix this: - Go to your Control Panel->Network->Services->Server and click Properties (if Properties is not available, you're probably running NT Workstation).
- You will be presented with a dialog box with four options.
Minimize Memory Usage | works well when your server is doing duty as a workstation, with 10 or fewer connections. | Balance | Good for systems doing serious local work like running network monitoring, with up to 64 connections. | File Sharing | Good for systems working as a file server. | Network Applications | Good for systems running an application server such as an email or database server. |
Tip - Latest Drivers Most IS shops use the drivers included on their NT CD-ROM when setting up a server. An easy way to make better use of your equipment is to get the latest drivers. This is especially important for network interface cards and SCSI/IDE adapters. Manufacturers frequently update their drivers to either fix bugs and/or add performance enhancements. All major manufactures post the latest drivers on their web sites. As with any software, finding stable versions can be a difficult process. Once you find a stable version of a driver, do not upgrade unless the driver specifically addresses a problem you're having or adds new functionality that you need. Make it a habit to read the release notes for drivers to see what has been fixed/added. Though manufacturers are becoming more and more reluctant to posting these release notes, you can generally find out what's new by calling the manufacturer or searching Deja. Tip - KISS (Keep it simple stupid) Other simple tips: - Set your screen saver "Blank Screen". It'll save your NT machine a couple CPU cycles and insure you don't find memory or other problems with poorly written screen savers.
- Unless absolutely necessary, do not install a sound card on an NT server. Or, if your motherboard has a built-in sound card, do not install the drivers. Sound cards, especially newer PCI ones,
- When you need a modem for an NT server, opt for a good external modem instead of an internal PCI modem. There are a couple good reasons for this. One, with an external modem it's easy to power-cycle the modem without rebooting the server. Two, its easy to see what the modem is doing. Three, the newer PCI modems ship with poor drivers which commonly lock up the PCI bus for brief periods of time. The newer drivers generally help, but its not worth saving a few bucks here. Plus, who needs a modem whose driver can GPF your server?
Tip - Name that Server! This really isn't a performance tip, but it greatly enhances your server's usability. When I visit other NT networks, I like to go into Network Neighborhood and see if any of the NT Workstations or Servers have a description. I'd say less than 10% of them out there show up with any description. Because NT doesn't ask for the computer description when asking for the computer name during network setup, most people assume NT doesn't support a description. Win9x both ask for the computer name and the description at the same time. Under NT, the description is tucked away... To add a description to your NT station, go to Control Panel->Server and enter the description in the description box and press OK. Don't be surprised if it takes a few minutes for it to show up. Under Windows 2000, you can set the comment by typing the following at the command line: NET CONFIG SERVER /srvcomment:"server comment"
This is really helpful for users who can't seem to remember which server houses the printers, or marketing data, etc. Just give each server a meaningful description. I also include the operating system and version in the comment/description. This way, I can see at a glance from the network neighborhood what OSes and versions are present on the network. I do this with the Win9x stations as well. Additional Information/Links
1997-2004 The Montopolis Group. All rights reserved. All products and company names mentioned here are or may be trademarks or registered trademarks of their respective owners. No part of this article may be reproduced or transmitted in any form or by any means without the prior written permission of the The Montopolis Group. The information in this article is presented without warranty, either express or implied. Neither the author(s) or The Montopolis Group will be held liable for any damages caused or alleged to be caused either directly or indirectly by this article.
|