Windows 95 provides the easiest methods and best defaults ever offered for configuring system memory and ensuring good performance on an x86-based computer. This chapter summarizes system features related to performance and describes tools for monitoring and managing system performance.
Windows 95 Performance Tuning: The Basics
Windows 95 Performance Tuning: The Issues
Optimizing File System Performance
Setting Graphics Compatibility Options
Optimizing Network Performance
Optimizing Conventional Memory
Tracking Performance with System Monitor
Windows 95 Performance Tuning: The Basics
u 32-bit installable file systems to support better performance and long filenames
The following tools in Windows 95 are available for managing performance-related settings:
u System Monitor can be used to track the performance of key system components.
For more information about DriveSpace and Disk Defragmenter, see Disks and File Systems.
Windows 95 Performance Tuning: The Issues
This section summarizes performance issues, which are related principally to computer hardware.
For information about performance related to network adapters.
Û To see a report of performance problems
If the performance status shows that real-mode components are being used for any device and especially for disk drivers you need to solve all the problems that prevent protected-mode drivers from loading. For information, see Devices. This chapter describes methods for optimizing or solving problems related to virtual memory, file system, or graphics performance.
System Resource Capacity in Windows 95
Windows 95 provides a significant increase in the system resources available to Windows-based and MS-DOS based applications over what was available under earlier versions of Windows. The net result for users is that they can count on more system resources being available for creating windows, using fonts, running five or more applications simultaneously, and so on.
Windows 3.1 maintained 64K regions of memory heaps for use by the graphics device interface (GDI) and USER system components. These heaps stored GDI or memory object information allocated when an application called a Windows API function. The amount of space available in the combination of these two heaps is identified as a percentage of system resources that are free (that percentage appears in the Help About dialog box in My Computer and other Windows-based applications). Under Windows 3.1, when the calculated amount of free space dropped to a low number, the system often reported that it was out of memory even though the amount of free memory shown in the About dialog box was still quite high. This was often due to low memory in either the GDI or USER heap, or both.
In Windows 95, to help reduce the system resource limitation, many data structures formerly stored in the 16-bit GDI and USER heaps are now stored in 32-bit heaps. This provides more room for the remaining data elements to be created.
The following table shows the system limits in Windows 95, as compared to the constraining limits under Windows 3.1. For information about the supporting architecture, see Windows 95 Architecture.
Windows 95 System Limits
Resource | |||||||
Windows Menu handles | |||||||
Timers | |||||||
COM and LPT ports | |||||||
Items per listbox | |||||||
Data per listbox | |||||||
Data per edit control | |||||||
Regions | |||||||
Physical pens and brushes | |||||||
Logical pens and brushes | |||||||
Logical fonts | |||||||
Installed fonts | |||||||
Device contexts | |||||||
1 Limits for
GDI objects in Windows 3.1 are not exact because all
regions, physical objects, logical objects, device
contexts (DCs), and installed fonts had to fit in a
single 64K segment. Because many of these have been moved
to the 32-bit heap, Windows 95 provides much more
room for those remaining items, such as logical pens,
brushes, and so on. The remaining items in the
Windows 95 local heap are all less than 10 20
bytes each. 2 System-wide resources, unless noted otherwise. |
Technical Notes on MS-DOS Components in Windows 95
Many users have wondered whether Windows 95 contains MS-DOS code, and if so, whether that means that Windows 95 is somehow built on top of MS-DOS. Many of these questions relate to how Windows 95 achieves the highest possible degree of compatibility with existing devices and the myriad applications created for MS-DOS and Windows 3.x. Three key questions are answered here:
u How does Windows 95 reclaim memory from real-mode drivers?
u Why does IO.SYS load WIN.COM rather than directly loading VMM32.VXD?
The following services are based on entirely new code created for Windows 95, not revisions to MS-DOS code:
u Interprocess communications and synchronization
u Preemptive Win32 subsystem
u CD-ROM, hard disk, and network I/O services
u High-level graphics operations and window management
u Printing services
Some functions, however, are handled by MS-DOS code, although the code itself is running in virtual 8086 mode, not real mode. Functions implemented in this manner ensure backwards compatibility with existing real-mode software, such as the Novell® NetWare® client. The following list shows such functions:
Create
Program Segment Prefix (function 55h) Create Temp File (function 5Ah) Dup File Handle (function 45h) Exit (function 4Ch) Get Date/Time (functions 2Ah and 2Ch) |
International (function 65h) Set/Get Drive (functions 0Eh and 19h) Set/Get Program Segment Prefix (functions 50h and 51h) NetWare Get Station Num (function DCh) |
An important example of how Windows 95 reclaims memory from real-mode device drivers is MSCDEX, the CD-ROM driver. After Windows 95 Setup is completed and Windows 95 starts from the hard disk for the first time, special code runs to determine whether the protected-mode CDFS drivers have taken over the CD-ROM drive completely. If so, the real-mode MSCDEX driver in memory is matched to the related lines in AUTOEXEC.BAT, and the MSCDEX entries are then commented out. This provides a trail in AUTOEXEC.BAT to show what has happened. Similar methods are used for other device drivers that Windows 95 knows to be safe to remove, such as other vendors real-mode disk cache utilities and redundant protected-mode VxDs.
As a final example, some users have wondered whether the fact that IO.SYS loads WIN.COM (rather than loading VMM32.VXD directly) is an indication that Windows 95 is built on Windows 3.x code, with the addition of new virtual device drivers. However, IO.SYS is used to load WIN.COM only for purposes of backward compatibility. Certain real-mode drivers and TSRs insert themselves at various places in the Windows 3.1 startup process. If Windows 95 were to bypass the loading of WIN.COM and instead load virtual device drivers directly, any driver that needs to insert itself when WIN.COM is loaded would never be called. Instead, Windows 95 starts in precisely the same way as Windows 3.1 and loads the same components in the same order, ensuring compatibility with earlier versions of applications and device drivers.
Optimizing the Swap File
Windows 95 uses a special file on your hard disk called a virtual-memory swap file (or paging file). With virtual memory under Windows 95, some of the program code and other information are kept in RAM while other information is swapped temporarily to virtual memory. When that information is required again, Windows 95 pulls it back into RAM and, if necessary, swaps other information to virtual memory. This activity is invisible, although you might notice that your hard disk is working. The resulting benefit is that you can run more programs at one time than the computers RAM would usually allow.
On Windows 3.x, users could enhance performance by changing virtual memory settings. The Windows 95 swap file is dynamic, so it can shrink or grow based on the operations performed on the system and based on available disk space. A dynamic swap file is usually the most efficient use of resources. The swap file can also occupy a fragmented region of the hard disk with no substantial performance penalty.
The Windows 95 swap file (WIN386.SWP) is not a permanent file. However, Windows 95 can also use a permanent Windows 3.1 swap file. In this case, the file cannot shrink below the permanent size set for it in Windows 3.1, although the file can grow bigger if required.
Under Windows 95, the swap file can reside on a compressed drive if a protected-mode driver (that is, DRVSPACE.VXD) controls the compressed drive. DriveSpace marks the swap file as uncompressible and, to reduce the risk of fragmentation, places the swap file as the last file in the sector heap, which allows room for the swap file to grow.
For a computer that runs a shared version of Windows 95 from a server, the swap file is placed in the computers machine directory. If the computer is started from a floppy disk or uses remote booting, the swap file is in the machine directory on the network. If the computer is started from the local hard disk, the swap file can be stored in the machine directory on the local computer.
Although the system defaults usually provide the best performance, you can adjust the parameters used to define the swap file. For example, to optimize swap file performance on a computer with multiple hard disk drives, you might want to override the default location of the Windows 95 swap file. The swap file should be placed on the drive with the fastest performance (unless that disk is overused). If a user usually loads all software from the same drive in a computer that has multiple drives, performance might be boosted by placing the swap file on one of the drives that is not as busy.
Completely disabling virtual memory might cause the computer to stop operating properly. You might not be able to restart the computer, or system performance might be degraded. Do not disable virtual memory unless instructed to do so by a technical support representative.
Û To adjust the virtual memory swap file
2. Click the Virtual Memory button.
3. To specify a different hard disk, click the option named Let Me Specify My Own Virtual Memory Settings. Then specify the new disk in the Hard Disk box. Or, type values (in kilobytes) in the Minimum or Maximum boxes. Then click OK.
{bml rk17_01.bmp}
If you set the maximum swap file size in the Virtual Memory dialog box to the amount of free space currently on a drive, Windows 95 assumes that it can increase the swap file beyond that size if more free disk space becomes available. If you want to impose a fixed limit on the swap file size, make sure that the limit you choose is less than the current maximum.
Optimizing File System Performance
In Windows 95, the disk cache is dynamic. You do not need to configure its size as part of system configuration. Because of this, the following types of settings used for Windows 3.x are not required in Windows 95 and should be removed from the configuration files.
Optimizing File System Performance with Profiles
Û To optimize file system performance
The values to be assigned to each disk performance profile are stored in the following Registry key:
Hkey_Local_Machine\Software\Microsoft\Windows\CurrentVersion
\FS Templates
The following subkey contains the actual settings for the profile currently used:
Hkey_Local_Machine\System\CurrentControlSet\Control\FileSystem
Optimizing CD-ROM File System Performance
Û To set the supplemental cache size for CDFS
2. In the CD-ROM Optimization area, drag the slider to set the supplemental cache size.
RAM size | ||||
8 MB or less | ||||
8 MB to 12 MB | ||||
12 MB or more |
For information about how VCACHE and the supplemental CD-ROM cache work, see Disks and File Systems.
Using File-System Troubleshooting Options
The System option in Control Panel presents a set of options for changing file system performance. You can use these options when you experience rare hardware or software compatibility problems.
Enabling any of the file-system Troubleshooting options will seriously degrade system performance. Typically, you want to enable these options only if instructed to do so by your product support representative.
Û To display the file-system Troubleshooting options
2. Click the File System button, and then click the Troubleshooting tab.
The following table summarizes the settings in Troubleshooting properties. Each option sets a value in this Registry key:
Hkey_Local_Machine\System\CurrentControlSet\Control\FileSystem
File system option | ||
Disable New File Sharing And Locking Semantics | ||
Disable Long Name Preservation For Old Programs | ||
Disable Protected-Mode Hard Disk Interrupt Handling | ||
Disable All 32-bit, Protected-Mode Disk Drivers | ||
Disable Write-Behind Caching For All Drives |
Setting Graphics Compatibility Options
In Windows 95, graphics hardware acceleration features can be turned off when system performance indicates incompatibility problems. Specifically, problems can occur when Windows 95 assumes a display adapter can support certain functionality that it cannot. In such cases, the side effects might be anything from small irregularities on the screen to system failure. You can disable hardware acceleration features of the display adapter so that the computer can still be used if there is a problem with the display adapter. If changing these settings fixes otherwise unexplained system crashes or performance problems, then the source of the problem is probably the computers display adapter.
Û To change graphics performance settings
2. Drag the slider to change the hardware acceleration setting, as summarized in the following list. Then click OK.
{bml rk17_09.bmp}
u The first notch from the right can be set to correct mouse pointer display problems. This setting disables hardware cursor support in the display driver by adding SwCursor=1 to the [Display] section of SYSTEM.INI.
u The second notch from the right can be set to correct certain display errors. This setting prevents some bit block transfers from being performed on the display card and disables memory-mapped I/O for some display drivers. This setting adds SwCursor=1 and Mmio=0 to the [Display] section of SYSTEM.INI, and SafeMode=1 to the [Windows] section of WIN.INI.
u The last notch from the right (None) can be set to correct problems if your computer frequently stops responding to input, or has other severe problems. This setting adds SafeMode=2 in the [Windows] section of WIN.INI, which removes all driver acceleration support and causes Windows 95 to use only the DIB engine rather than bit block transfers for displaying images.
For example, if you receive an error message at system startup stating that an application caused "an invalid page fault in module <unknown>," this indicates a problem between the display driver and the Windows 95 DIB engine. In such cases, this setting should correct the problem.
For more information about the built-in graphics performance features in Windows 95, see Devices, and Windows 95 Architecture.
Optimizing Printing
Printing to a printer attached to a file or print server occurs differently, depending on the servers operating system. If you print to a server running Windows 95, the rendering from the EMF format to the printer-specific language happens on the server. This means that less work is performed on the client computer, giving the user better performance.
When you print to NetWare or Windows NT servers, the rendering from EMF to the printer-specific format happens on the client computer. Although this happens in the background, it still means more work is performed on the client computer. Printing to a printer attached locally causes both the EMF rendering and the device-specific rendering to happen on the computer. For more information, see Printing and Fonts.
You also need to decide on the trade-off between disk use and return-to-application time when configuring printing in Windows 95.
Û To define spool settings for print performance
2. Click the Details tab, and then click Spool Settings.
{bml rk17_08.bmp}
u Click Start Printing After Page Is Spooled if you want the second rendering to take place simultaneously with the writing of the EMF file. This reduces the total print time and disk space required, but it increases the return-to-application time.
Optimizing Network Performance
Windows 95 automatically adjusts system parameters to accommodate user demands and various network configurations. For example, it alters the size of the system paging file and cache buffer as memory requirements change and automatically tunes network time-out values to fit varying LAN topologies.
With a few exceptions, manual tuning of operating system parameters is not required to improve network performance. However, you can take several other measures that can increase file-sharing performance, such as reconfiguring or changing hardware components. This section summarizes these measures.
For example, the Microsoft Client for NetWare Networks significantly out-performs the VLM or NETX version of the NetWare client. On large block transfers over the network, Client for NetWare Networks is up to twice as fast as Windows 3.x with the VLM shell, based on benchmarks performed by beta testers. The protected-mode networking client can take advantage of caching and other automatic tuning features. With a real-mode client, you are limited to the same performance tuning capabilities that were available under Windows 3.x.
u Use the new NDIS 3.1 network adapter drivers provided with Windows 95.
u Install a new network adapter. The adapters currently available provide markedly better performance than earlier models. If possible, select an adapter that matches the computer bus. For more information, see Network Technical Discussion.
Network adapters have become exceptionally reliable and inexpensive. The low costs of Ethernet adapters, including new Plug and Play hardware, means that usually the most cost-effective way to improve network performance is to replace an older network adapter with a new model. The cost for the new hardware is offset almost immediately by savings in support time and improved performance.
The following measures can help you obtain the best performance from computers that provide File and Printer Sharing services:
u Make sure the computer has enough memory, depending on the size of your network and the number of users who will be accessing the peer server.
u In the System option in Control Panel, set the typical role of the computer to Network Server.
u Install a high-performance network adapter on the peer server. If the computer uses an 8-bit adapter, you can increase performance significantly by replacing it with a high-performance 16-bit or 32-bit adapter.
u Disable rarely used network adapters. This improves overall network performance by decreasing the number of broadcast packets on the network. Each broadcast packet must be processed by every active adapter on the network. High broadcast rates adversely affect LAN performance by increasing network connection time. You can disable a network adapter by disabling its binding to protocols in the Network option in Control Panel.
u Install faster hard disks or disk controllers (or both). Typically, when setting up peer servers, you will want to choose computers configured with the best-performing hardware.
u On a computer running File and Printer Sharing for NetWare Networks, set the read-only attribute on shared files wherever possible. The network client can take better advantage of file caching with read-only files, which will improve network performance and reduce the load on the server.
Optimizing Conventional Memory
The methods for conventional memory management under Windows 95 are the same as for MS-DOS 6.x:
u Remove as many real-mode drivers and TSRs from CONFIG.SYS and AUTOEXEC.BAT as possible, and instead use new protected-mode drivers and applications created for Windows 95.
u Use buffershigh, fcbshigh, fileshigh, lastdrivehigh, and stackshigh to ensure that reserved memory is taken out of the upper memory area. For information about these commands.
u Do not load smartdrv in your configuration files, except in configuration files for an application that you run in MS-DOS Mode. Windows 95 uses an improved method for disk caching, so loading smartdrv typically wastes memory that could be used by MS-DOS based applications.
You can still run the MEMMAKER utility provided with MS-DOS 6.2x to load real-mode drivers in the upper memory blocks (UMB). This utility is available in the OTHER\OLDDOS directory on the Windows 95 compact disc.
For information about MS-DOS Mode, and other configuration issues related to MS-DOS based applications, see Application Support. For specific information about MS-DOS memory settings, consult the Microsoft MS-DOS 6.2 Technical Reference or other books on MS-DOS memory management.
Dont assume that running an MS-DOS based application in MS-DOS Mode provides better performance. When an application runs in MS-DOS Mode, Windows 95 and all of its protected-mode drivers are unloaded, so the application is running in real mode with exclusive use of the computers resources. Although this might help with a few applications that otherwise cannot run under Windows 95, it does not benefit performance overall because the application doesnt get the benefit of protected-mode drivers, VCACHE, 32-bit disk access, and so on. Also, real-mode device drivers must be loaded, reducing the amount of conventional memory available to the application. |
Tracking Performance with System Monitor
System Monitor is a Windows 95 tool you can use to help determine the cause of problems on a local or remote computer by measuring the performance of hardware, software services, and applications. When you make changes to the system configuration, System Monitor shows the effect of your changes on overall system performance. You can also use System Monitor to justify hardware upgrades.
Before making major configuration changes, use System Monitor to evaluate your current configuration; this can help you determine whether a particular system or network component is acting as a performance bottleneck.
Û To install and run System Monitor
2. In the Components list, make sure Accessories is checked, and then click Details.
3. In the Components list, make sure System Monitor is checked, and then click OK.
4. To install System Monitor, click OK.
5. To run System Monitor, click the Start button, click Run, and then type sysmon
Û To use System Monitor to monitor remote computers
2. Click the File menu, and then click Connect.
3. Type the computer name of the computer you want to monitor, and then click OK.
Notice that monitoring a remote computer requires user-level security.
Configuring Performance Charts in System Monitor
System Monitor uses the dynamic data information in the Registry to report on the state of processes. You can use System Monitor to do the following:
u Determine system capacity and identify bottlenecks.
u Monitor the effects of system configuration changes.
Û To use System Monitor to track performance problems
2. In the Category list, click the resource that you want to monitor.
3. In the Item list, select one or more resources that you want to monitor.
To select more than one item, press CTRL while clicking the items that you want to select. To select several items in a row, click the first item, and then press and hold down shift while clicking the last item.
{bml rk17_02.bmp}
{bml rk17_03.bmp}
System Monitor offers menu commands for configuring the charts:
u To configure the color and scaling for a selected item, click the Edit menu, and then click Edit Item.
u To control the display of the toolbar, status bar, and title bar, click the View menu, and then click Toolbar, Status Bar, or Hide Title Bar, respectively.
Identifying Performance Problems with System Monitor
If you want to use System Monitor effectively, you need to run it frequently to become familiar with what typical performance looks like for a standard configuration so that you can recognize performance problems when they appear in System Monitor.
To become well-acquainted with System Monitor, run it while you are doing your usual work under Windows 95. To do this, add the System Monitor icon to your desktop. Then run System Monitor and use commands on the View menu to remove the title bar or to force the window to be always on top.
The following presents some general guidelines and key settings for using System Monitor in troubleshooting performance problems:
u If the values for Memory Manager: Discards and Memory Manager: Page-outs indicate a great deal of activity, performance problems might be related to system memory stress. These values might indicate a need for more physical memory.
u If a computer seems slow, check the values reported by Kernel: Processor Usage (%) and by Memory Manager: Page Faults and Memory Manager: Locked Memory, as described in the following list:
u If the values for Memory Manager: Page Faults are high, it might indicate that the applications being used have memory needs that are beyond the computers capabilities.
u If the Memory Manager: Locked Memory statistics continually are a large portion of the Memory Manager: Allocated Memory value, then inadequate free memory might be affecting performance. Also, you might be running an application that locks memory unnecessarily. (Locked memory indicates the portion of memory used that cannot be paged out.)
Summary of System Monitor Categories
System Monitor tracks functionality for the following categories:
u IPX/SPX Compatible Protocol
u Kernel
u Memory Manager
u Microsoft Client for NetWare Networks and Microsoft Network Client
u Microsoft Network Server (File and Printer Sharing service)
u Microsoft Network Monitor Performance Data
Because System Monitor uses Registry information, drivers can be written to report additional information in System Monitor. For information about creating such drivers, see the Windows 95 Device Development Kit.
The following tables describe the settings for the built-in System Monitor categories.
File System
Setting | ||
Bytes Read/Second | ||
Bytes Written/Second | ||
Dirty Data | ||
Reads/Second | ||
Writes/Second |
IPX/SPX Compatible Protocol
Setting | ||
IPX Packets Lost/Second | ||
IPX Packets Received/Second | ||
IPX Packets Sent/Second | ||
Open Sockets | ||
Routing Table Entries | ||
SAP Table Entries | ||
SPX Packets Received/Second | ||
SPX Packets Sent/Second |
Kernel
Setting | ||
Processor Usage (%)1 | ||
Threads | ||
Virtual Machines | ||
1 Monitoring processor usage will increase processor usage slightly, so dont monitor this setting unless you are investigating a problem. |
Memory Manager (VMM32)
Setting | ||
Allocated Memory1, 2 | ||
Discards | ||
Disk Cache Size | ||
Free Memory | ||
Instance Faults | ||
Locked Memory1 | ||
Maximum Disk Cache Size | ||
Minimum Disk Cache Size | ||
Other Memory1 | ||
Page Faults | ||
Page-ins | ||
Page-outs | ||
Swapfile Defective | ||
Swapfile In Use | ||
Swapfile Size | ||
Swappable Memory1 | ||
1 This number
includes the disk cache. To see the actual size, subtract
the value of Disk Cache Size. 2 For any Windows-based application that uses common dialog boxes, the spooler, OLE, and so on, handles are cached for later use, so not all resources will be freed when the application closes. |
Microsoft Client for NetWare Networks
Setting | ||
Burst Packets Dropped | ||
Burst Receive Gap Time | ||
Burst Send Gap Time | ||
Bytes In Cache | ||
Bytes Read Per Second | ||
Bytes Written Per Second | ||
Dirty Bytes In Cache | ||
NCP Packets Dropped | ||
Requests Pending |
Microsoft Network Client (Client for Microsoft Networks)
Setting | ||
Bytes Read/Second | ||
Bytes Written/Second | ||
Number Of Nets | ||
Open Files | ||
Resources | ||
Sessions | ||
Transactions/ Second |
Microsoft Network Server (File and Printer Sharing for Microsoft or NetWare Networks)
Setting | ||
Buffers | ||
Bytes Read/Sec | ||
Bytes Written/Sec | ||
Bytes/Sec | ||
Memory | ||
NBs | ||
Server Threads |
Microsoft Network Monitor Performance Data1
Setting | |||
Mediatype2 broadcasts/sec | |||
Mediatype bytes/sec | |||
Mediatype frames/sec | |||
Mediatype multicasts/sec | |||
1 Gathering
these statistics on a heavily used, low-performance
computer will impact performance. 2 Mediatype can be Ethernet or TokenRing. |