Thursday, August 29, 2013

How to determine the appropriate page file size for 64-bit versions of Windows

When you set up a 64-bit version of Microsoft Windows Server 2003 or Microsoft Windows XP, the operating system will create a page file that is one and a half times the amount of RAM that is installed in your computer. However, as the amount of RAM in a computer increases, the need for a page file decreases. The following guidelines and methods will help you determine the appropriate page file size for your system.

Comparison of memory and CPU limits in the 32-bit and 64-bit versions of Windows

When you set up a 32-bit version or a 64-bit version of Windows Server 2003 or Windows XP, a page file is created that is one and a half times the amount of RAM that is installed in the computer provided there is sufficient free space on the system hard disk. However, as more RAM is added to a computer, the need for a page file decreases. If you have enough RAM installed in your computer, you may not require a page file at all, unless one is required by a specific application.

The following chart illustrates the amount of RAM and the number of CPUs that can be installed on a computer depending on the operating system that is installed. RAM and CPU limits are much larger in 64-bit operating systems than in 32-bit operating systems.
General memory limits32-bit64-bit
Total virtual address space4 gigabytes (GB)16 terabytes
Virtual address space per 32-bit process2 GB, 3 GB if the system is booted with the /3GB switch2 GB, 4 GB if the application is compiled with the /LARGEADDRESSAWARE switch
Virtual address space per 64-bit processNot applicable8 terabytes
Paged pool470 megabytes (MB)128 GB
Non-paged pool256 MB128 GB
System cache1 GB1 terabyte
Physical memory and CPU limits32-bit64-bit
Windows XP Professional4 GB / 1-2 CPUs128 GB / 1-2 CPUs
Windows Server 2003, Standard Edition4 GB / 1-4 CPUs32 GB / 1-4 CPUs
Windows Server 2003, Enterprise Edition64 GB / 1-8 CPUs1 terabyte / 1-8 CPUs
Windows Server 2003, Datacenter Edition64 GB / 1-32 CPUs1 terabyte / 1-64 CPUs
Windows Server 2003 SP1, Enterprise Edition64 GB / 1-8 CPUs1 terabyte / 1-8 CPUs
Windows Server 2003 SP1, Datacenter Edition64 GB / 1-32 CPUs1 terabyte / 1-64 CPUs
There is no specific recommendation for page file size. Your requirements will be based on the hardware and software that you use and the load that you put on the computer. To monitor page file usage and requirements, run System Monitor, and gather a log during typical usage conditions. Focus on the following counters.
Counter thresholdSuggested value
Memory\\Available BytesNo less than 4 MB
Memory\\Pages Input/secNo more than 10 pages
Paging File\\% UsageNo more than 70 percent
Paging File\\% Usage PeakNo more than 70 percent
Process\\Page File Bytes PeakNot applicable
Note Page file use should be tracked periodically. When you increase the use or the load on the system, you generally increase the demand for virtual address space and page file space.

The Pages/sec counter

When you use System Monitor, the values that are returned by the Pages/sec counter for the Memory performance object may be more than you expect. These values may not be related to either paging file activity or cache activity. Instead, these values may be caused by an application that is sequentially reading a memory-mapped file.

The Pages/sec counter counts the number of pages that are read from the disk or that are written to the disk to resolve memory references to pages. These pages were not in memory at the time of the reference. The Pages/sec value is the sum of the Pages Input/sec and Pages Output/sec counter values. The Pages/sec counter includes paging traffic on behalf of the system cache to access file data for applications. 

Pages/sec is the primary counter to watch if you are concerned about excessive memory pressure (thrashing) and the excessive paging that may result.

However, the Pages/sec counter also accounts for other activity, such as the sequential reading of memory-mapped files that are either cached or not. Typically, the Pages/sec counter is counting other activity when you see the following:
  • A high value for the Memory: Pages/sec counter.
  • An average value, relative to the system being monitored, or a high value for the Memory: Available Bytes counter.
  • An average or small value for the Paging File: % Usage counter.
  • For a non-cached memory-mapped file, you also see average or low cache activity. (Low cache activity is also known as cache fault activity.)
Therefore, a high value for the Memory: Pages/sec counter does not necessarily indicate memory pressure or a System Monitor reporting error. To gain an accurate reading of your system, you must also monitor other counters.

How to calculate page file size

Use one or more of the following methods to help you calculate page file size.

Method 1: Use performance logs to understand the paging activity on your computer

  1. Click Start, point to Administrative Tools, and then click Performance.
  2. Expand Performance Logs and Alerts, click Counter Logs, right-click the blank space in the right-pane, and then clickNew Log Settings.
  3. In the Name box, type a name for the log, and then click OK.
  4. On the General tab, click Add Counters.
  5. Click Use local computer counters.
  6. In the Performance object list, click Paging File.
  7. Click Select counters from list, click % Usage, and then click Add.
  8. In the Performance object list, click Memory.
  9. In Select counters from list, click Available Bytes, and then click Add.
  10. In Select counters from list, click Pages Input/sec, click Add, and then click Close.
  11. Click OK.
Use the log that you collect during typical computer use to understand the paging activity on your computer. Then, adjust the page file size accordingly.

Method 2: Use the Page File Bytes Peak counter to calculate page file size

  1. Click Start, point to Administrative Tools, and then click Performance.
  2. Click System Monitor.
  3. In the right pane, click + (the Add button).
  4. Click Use local computer counters.
  5. In the Performance object list, click Process.
  6. Click Select counters from list, click Page File Bytes Peak, click Add, and then click Close.
  7. Let the counter run during typical use of your computer.
  8. Note the maximum value for the Page File Bytes Peak counter, and then multiply the value by 0.70. The sum of the equation is the size to set for your page file.

Method 3: Calculate the minimum and maximum page file size

To determine the approximate minimum page file that is required by your system, calculate the sum of peak private bytes that are used by each process on the system. Then, subtract the amount of memory on the system. 

To determine the approximate maximum page file space that is required for your system, calculate the sum of peak private bytes that are used by each process on the system. Then, add a margin of additional space. Do not subtract the amount of memory on the system. The size of the additional margin can be adjusted based on your confidence in the snapshot data that is used to estimate page file requirements. 

Note This estimate is accurate only if the snapshot of data that is used to make the calculations is accurate.

Page file input/output rates

To avoid overloading the system or other disks with page input/output (I/O) activity, use the following guidelines when you set up the page file on your computer:
  • If the page I/O (real disk I/O) rate is more than 10 pages per second, we recommend that you do not put the page file where the I/O activity occurs on the system disk. When the page I/O rate is 10 pages per second or more, we recommend that you dedicate a separate hard disk for paging.
  • If the page I/O rate to a particular disk that is used for paging is more than 60 disk I/O operations per second, use more than one dedicated page hard disk to obtain better performance. To do this, use multiple non-striped disks for paging, or use raid 0 striped disks for paging. Dedicate approximately one I/O hard disk to paging for every 60 pages per second of I/O activity.

    For example, if a system is averaging 150 pages of I/O activity per second, use three individual hard disks, or a three-disk raid 0 stripe set for the page file.

    Note These estimates are for hard disks that run at 7200 revolutions per minute (rpm). If you use a hard disk that runs faster, the I/O rate a disk can handle for page I/O will increase.

    Note If peak performance is critical to your system, use peak I/O rates instead of average I/O rates for these calculations.
Important Supportability Information: This article is specifically for computers that do not need kernel mode or full memory dump analysis. For business-critical servers where business processes require to server to capture physical memory dumps for analysis, the traditional model of the page file should be at least the size of physical ram plus 1 MB, or 1.5 times the default physical RAM. This makes sure that the free disk space of the operating system partition is large enough to hold the OS, hotfixes, installed applications, installed services, a dump file, and the page file. On a server that has 32 GB of memory, drive C may have to be at least 86 GB to 90 GB. This is 32 GB for memory dump, 48 GB for the page file (1.5 times the physical memory), 4 GB for the operating system, and 2 to 4 GB for the applications, the installed services, the temp files, and so on. Remember that a driver or kernel mode service leak could consume all free physical RAM. Therefore, a Windows Server 2003 x64 SP1-based server in 64-bit mode with 32GB of RAM could have a 32 GB kernel memory dump file, where you would expect only a 1 to 2 GB dump file in 32-bit mode. This behavior occurs because of the greatly increased memory pools.

No comments:

Post a Comment