The Well-Tuned Server, Part 1by Mitch Tulloch, author of Windows Server 2003 in a Nutshell
No one likes it when a band is performing and one of the instruments is out of tune. Poorly tuned servers can likewise spoil the performance of your network. And poor network performance means slow applications (lost time) and underused resources (wasted money). Tuning servers is therefore an essential part of the administrator's job.
In this first part of a two-part article, we'll look at how to tune file servers by managing disk quotas, and how to avoid the many "gotchas" you might face along the way. (Of course, everything we say here also applies to other sorts of content-hosting servers like web servers.) In the next article, we'll delve into the specifics of tuning Web servers.
Despite their faded luster, file servers are still the workhorse of many corporate networks. One of the simplest ways to use file servers more effectively is to implement disk quotas, a built-in feature of Windows 2000 and later. Disk quotas limit the amount of disk space users are allowed for storing their work, letting you make better use of storage resources on your network. That way you can avoid having some file servers underutilized with a great deal of free space (wasted money), while others run out of space, forcing you to add more drives or move some user folders to other servers (lost time).
Before you start configuring disk quotas on your servers, you need a plan. The main issue is: How much disk space do users need? Giving users too much space is wasteful and encourages them to be sloppy managing their files, while assigning them too little space will result in more support calls, costing your company time and money.
Since disk quotas in Windows are on a per-user, per-volume basis, enabling quotas on a specific volume means all users who store files on that volume will be subject to the same restrictions. (You can, however, override the quota setting on a user-by-user basis.) For example, if you enable quotas on G: drive and limit disk space to 50 MB per user (as shown in Figure 1) then any user who creates, copies, moves, or takes ownership of a file on this volume will be restricted to 50 MB of storage space, regardless of what folders their files are in.
Figure 1. Enabling disk quotas on an NTFS volume.
As I previously said, you can override this quota setting on an individual user basis, but doing that can be very time-consuming if you have many users in your organization. A better approach would be to group users into several categories according to storage needs, for example light users (25 MB), moderate users (50 MB), and heavy users (100 MB). Then for each file server, dedicate some volumes for the work folders of light users, other volumes for moderate users, and the rest for heavy users. Finally, assign quotas to each volume depending on the category of users who store files on the volume.
Don't forget to plan for growth, which is easily accomplished by adding more drives and creating additional volumes (or by enlarging existing volumes using spanned volumes). Be sure also to leave some unallocated space on your volumes in case you need to override quota settings for a few users should circumstances suddenly require it.
Once you've devised a quota plan, enable quotas on appropriate volumes using the Quota tab on the volume's properties sheet (see Figure 1 again). To get there, right-click on the volume, and choose Properties-->Quota. Then check the box next to Enable quota management.
You can choose to implement either hard quotas (select the "Deny disk space to users exceeding quota limit" checkbox) to prevent users from exceeding their quota, or soft quotas (clear the "Deny disk space to users exceeding quota limit" checkbox) if you just want to monitor quota usage in Event Viewer.
If you decide on soft quotas, your event log will record different events depending on whether the user exceeds his warning level ("A user hit their quota threshold on volume...") or quota limit ("A user hit their quota limit on volume..."). With soft quotas, users themselves are not warned when they exceed their warning level or quota limit -- the only thing that happens is that an event of type Information and source "ntfs" is recorded in the System log.
Hard quotas, however, alert users when they attempt to exceed their quota limit and prompt them to delete unneeded files or run Disk Cleanup to reclaim space. If you're confident of your earlier planning, you can implement hard quotas right from the start. Otherwise, go with soft quotas and monitor event logs carefully to see if your estimates of storage needs for users are realistic.
Once quotas are configured, you can view usage statistics in the Quota Entries window, shown in Figure 2, by clicking the Quota Entries button on the Quota tab.
Figure 2. Viewing quota usage statistics for a volume.
Selecting View-->Containing Folder from the menu bar lets you display the domain and organizational unit each user belongs to, which can help you get a better understanding of storage use by department or division. A yellow Warning symbol under Status means the user has exceeded her warning level, while an red Above Limit symbol means she passed her quota limit (Above Limit is only displayed when soft quotas are used). Double-clicking on an individual quota entry lets you override the per-volume quota settings for that user if needed.
While the basics of setting quotas are straightforward, there are still a lot of gotchas you'll need to watch out for. Check out the following advice for handling them.
Don't set hard quotas on the system or boot volume or some applications may fail, particularly if you install them using an account that doesn't have administrative privileges. And don't modify the default quota entry setting of
No Limit for special identifies like
NT_AUTHORITY\SYSTEM, otherwise you may not be able to log on afterwards.
Services like IIS can also fail if they have no room for writing their log files. Printing can also fail since the print spooler folders reside on the system volume. Even administrative tools like Computer Management may not start if the TEMP folder has no room to grow. Worst case, the operating system could grind to a halt if there is no room for the pagefile to grow. Ouch!
Wherever possible, create separate folders on quota-enabled volumes for users to store their own work. Otherwise, one user could use up another user's quota on the volume by simply copying their files. If several users must share access to the same folder, place that folder on a volume whose quota limit is the "heavy users" category.
Here's a common scenario: A user has 25 MB of files on a quota-enabled volume, tries to free up space by deleting 5 MB of old files, checks the volume in My Computer and it still shows 25 MB of files, and calls Support to complain that something doesn't work. The problem? When the user deleted his files, they were simply moved to the Recycle Bin on the quota-enabled volume. The solution: educate users to either empty their Recycle Bin, hard-delete files using SHIFT+DELETE, or run Disk Cleanup.
Another problematic scenario: User creates files, exceeds warning level, event is written to event log. User immediately hard-deletes files so disk usage falls under warning level. User immediately creates more files and exceeds warning level again. But when you check the event log, there is only one "user hit their quota threshold" event recorded. Why? Windows waits one hour after writing a quota event for a user before writing the same event a second time. You can modify the quota notification time by editing the registry. See Microsoft Knowledge Base article 228812 for more details.
Supplement One to the Microsoft Windows 2000 Server Resource Kit contains two useful Perl scripts, diskquotasettings.pl for viewing and configuring disk quota settings on volumes, and diskquotas.pl for working with individual quota entries. See Microsoft Knowledge Base article 320047 for instructions on how to run these scripts using ActivePerl from ActiveState.
Want a quick hard-copy report of quota usage on a volume? Open the Quota Entries window for the volume, select everything, and drag into Word or Excel, and then print it out.
Need to copy quota entries for users from one quota-enabled volume to another? Open an instance of the Quota Entries window for both volumes and drag entries from one volume to the other. This is useful if you have modified a number of individual quota entries on one volume and want to replicate this on other volumes.
Think you can save space on a quota-enabled volume by compressing files? You may actually find your files using more space instead of less! See Microsoft Knowledge Base article 320686 for reasons why.
Want to use quotas with the Distributed File System (DFS) in an Active Directory environment? Don't -- it can be a mess. See Microsoft Knowledge Base article 816945 for more details.
Want to easily configure quota settings on multiple computers using Group Policy? Look under Computer Configuration-->Administrative Templates-->System-->Disk Quotas and configure the policy settings of your Group Policy Object (GPO) as desired. Also note the "Disk quota policy processing" policy setting under Computer Configuration-->Administrative Templates-->System-->Group Policy, which determines when and how policies relating to disk quotas are processed by Group Policy. Any quota settings configured using Group Policy will be ghosted out on the Quota Tab of quota-enabled volumes.
Mitch Tulloch is the author of Windows 2000 Administration in a Nutshell, Windows Server 2003 in a Nutshell, and Windows Server Hacks.
Return to WindowsDevCenter.com.
Copyright © 2009 O'Reilly Media, Inc.