Many administrators are familiar with the option in Windows 2000 to either give equal processing time to foreground and background processes or to give foreground processes slightly high priority. However, there are ways to provide additional levels of granularity and flexibility to foreground and background processes. To do this, we need to edit the way Windows 2000 handles quantum lengths.
Microsoft uses the term "quantum" to refer to the minimum amount of time spent executing one thread before switching to another thread. These intervals are actually not set in stone; they can be adjusted to some degree. Depending on the kind of programs and services you're running, you may want to give preference and adjust quantum timings to something other than the default settings.
The variations to quantum settings allow for their lengths to be fixed or variable, long or short, and (as we originally knew) biased towards foreground or background processes. Variable-length quanta are useful if you have services that kick in and out and use a lot of CPU time in bursts.
For instance, on a server that runs primarily background processes with a lot of CPU usage (IIS, SQL), you may want to set the system to favor those and use short variable-length timeslices to let everything run in as much a parallel fashion as possible. You might need to do a certain amount of experimenting to find the optimal settings for your combination of services.
To edit the quantum length parameters:
- Open the Registry and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl.
- Look for the value named Win32PrioritySeparation.
- This value is a bitmask, so set the value to 0 and add values as follows.
- If you want to set the ratio of foreground-to-background threads to:
3:1, add 2; for 2:1, add 1; for 1:1, add 0.
- If you want to set the lengths of quanta to variable lengths, add 4; for fixed lengths, add 8.
- If you want to set the intervals for quanta to be shorter, add 32; to make them longer, add 16.
- If you want to set the ratio of foreground-to-background threads to: 3:1, add 2; for 2:1, add 1; for 1:1, add 0.
- Record the final value and click OK.
The change takes effect immediately.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter.
This was first published in November 2002