Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

May 01, 1998 12:00 AM

Paging Peformance

Windows IT Pro
InstantDoc ID #3615
Rating: (0)
LEARN HOW TO INCREASE YOUR SYSTEM'S EFFICIENCY

Microsoft designed Windows NT to use paging for virtual memory regardless of how much physical memory is available. Paging is the process of temporarily transferring some of the contents of a system's physical memory to the hard disk until the system needs the contents of that memory again. When NT starts, it creates a paging file (pagefile.sys) on the hard disk to store information. Paging frees up physical memory on the system and lets more processes execute. When a process needs code or data that was swapped to the hard disk, the system puts that code or data back into physical memory and transfers other information to the hard disk if necessary. The difference in performance between a hard disk and physical memory is astounding. Hard disk access time is typically 10 milliseconds (ms), whereas physical memory access time is around 60 nanoseconds (ns). Accessing memory is several orders of magnitude faster than accessing the most technologically advanced hard disk drives.

To make your system run more efficiently, you must minimize the effects of paging. One option to reduce paging activity is to add memory. Adding memory reduces the likelihood that the system will rely solely on the hard disk for virtual memory. You can monitor your system's changing memory requirements and properly configure the paging file to maximize paging performance. You must consider the paging file location and size.

Paging File Location Considerations
During the installation process, NT uses contiguous disk space to automatically create the paging file. NT always places the file in the system partition's root directory, although this location is not necessarily ideal. To achieve optimal paging performance, you must look at your disk subsystem configuration to determine whether your system has more than one physical hard disk. If your system has only one hard disk, you'll want to consider adding an extra hard disk. NT supports as many as 16 paging files that it can distribute across multiple drives. Configuring the system to have multiple paging files lets the system make multiple, simultaneous I/O requests to the various hard disks, thereby increasing I/O requests to the paging file.

A system with only one hard disk limits your ability to optimize paging performance. The hard disk must process system and application requests and access the paging file. The physical hard disk might have multiple partitions, but dispersing the paging file among the partitions is a bad idea. Multiple paging files spread across multiple partitions do not increase the hard disk's ability to read or write to the pagefile.sys file. In fact, this setup impedes system performance, because the hard disk must handle paging requests for multiple paging files. However, you can use multiple smaller paging files on multiple partitions on one physical disk when a partition lacks the space to contain an entire paging file.

Calculating Paging File Size
The size of the paging file is critical. Regardless of how many paging files you create, you need to properly size them, or your system will have performance problems. If the paging files are too small, the system might have to enlarge them to compensate for increased paging activity. When a system increases paging file size on the fly, it has to create new space for the paging file while handling paging requests. In this situation, the system will experience excessive page faults. A page fault is when the system must find information outside the process' working set, either elsewhere in physical memory or in the paging file. The system might also start thrashing. Thrashing is when the system lacks the physical and virtual memory resources to satisfy usage requirements and thus relies on the disk subsystem for virtual memory. Thrashing causes the system to spend more time paging than executing applications. Thrashing occurs when the Memory: Pages/sec counter that you monitor from Performance Monitor (Perfmon) is consistently above 100 pages per second. This problem severely decreases system performance. Expanding the paging file on the fly also causes fragmentation. The system might scatter the paging file throughout the disk rather than maintaining it in contiguous space. This fragmentation introduces system overhead and severely degrades performance. Don't make the system responsible for increasing the paging file size.

Microsoft recommends a minimum paging file size of physical RAM + 11MB. During installation, NT configures the minimum paging file size to reflect this value. To determine the appropriate paging file size for your system, you'll want to estimate paging requirements during typical usage (as I explain later in the article), compare your estimate with Microsoft's recommendation, and use the higher value as the minimum. If you want to configure multiple paging files for a system, the minimum size applies to the paging files collectively rather than to each paging file.

To change the paging file's location or size configuration parameters, open the System applet in Control Panel or right-click My Computer on the desktop and select Properties. On the Performance tab, click Change. In the Virtual Memory dialog box, you can change the paging file's location or size to meet the anticipated requirements, as Screen 1 shows. To add another paging file to the existing configuration, select a hard disk that doesn't already have a paging file. Specify the initial size and maximum size (in megabytes) for the paging file, and click Set, OK. Reconfigure the other paging files so that the sum of their minimum sizes reflects the minimum size for the entire system.

To change a paging file's minimum and maximum size, select the hard disk where the paging file resides. Specify the initial size and maximum size (in megabytes) for the paging file, and click Set, OK. Click OK on the System Properties dialog box. When the system prompts you to restart the computer, click Yes.

NT provides several tools to help you determine the system's paging requirements. You can use Task Manager, NT Diagnostics (winmsd.exe), or Perfmon to determine the proper size so the paging file doesn't have to expand on the fly during normal operation.

The absolute minimum paging file size is only 2MB. However, your system performance will suffer if you set the paging file size to such a low value, because the system will have to expand the paging file until it can meet paging requests.

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Jan 11, 2005

    MY SYSTEM WONT ALLOW ME TO GET INTO WINDOWS BECAUSE MY PAGE FILE IS TO SMALL, CAN YOU HELP ME

  • Michael Vuister
    13 years ago
    Aug 11, 1999

    In “Paging Performance” (May), Kenton Gardinier states that a system with multiple hard disks can make simultaneous I/O requests to the various hard disks. This statement is true for SCSI disks, which have queuing, but is it true for EIDE disks, which process only one request at a time? (Hard disks are rarely connected to the secondary EIDE controller, so the primary controller processes all requests for hard disk access.)
    The author also states that the worst case occurs when the initial and maximum paging file sizes are equal. I purposely set the values equal (and large) to prevent paging file fragmentation. Perhaps the article could have included instructions to address paging file fragmentation (e.g., use Control Panel to put the file temporarily on another partition, run a defragmentation utility, and put the file back).

    --Michael Vuister



    I agree with your statement regarding the disk subsystem configuration. The article should have included clarification.
    The paging file fragments under only two conditions: You have a low amount of disk space during the creation of the paging file at startup, or the paging file is forced to grow beyond the minimum value during normal operation. If the paging file needs more space, it dynamically increases as needed (and with a warning) up to the maximum value. After the paging file grows to the maximum value, the system becomes unstable and can crash. In your configuration, you might be wasting disk space and not providing any padding to prevent instability. In other words, what happens to your system if the paging file reaches the minimum or maximum value?

    --Kenton Gardinier

  • Al Mulnick
    13 years ago
    Aug 11, 1999

    I read and thoroughly enjoyed Kenton Gardinier’s “Paging Performance” (May) about monitoring and tuning the paging file to improve performance. I’d like to point out that following the advice in the article and dividing the swap file across different disks will prevent the creation of a memory.dmp file in the event of a blue screen trap. Windows NT displays a warning about this situation, which might be acceptable to some users.

    --Al Mulnick




    NT doesn’t create a memory dump after a system crash in several situations: for example, when the %SYSTEMROOT% partition or other specified path does not have enough space, you haven’t selected the overwrite option, or you haven’t selected an adequate paging file size on the %SYSTEMROOT% partition. In the article, I didn’t mention the correlation between paging file size and memory dumps. To allow memory dumps, you must keep a paging file on the system partition with a size equal to or greater than the amount of physical memory plus an additional MB. Thanks for mentioning this point.
    --Kenton Gardinier

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.