<p>Does any know a good rule of thumb for the appropriate pagefile size for a Windows 2003 server running SQL Server?</p>

[{'answer_id': 7712, 'author': 'Sean Carpenter', 'author_id': 729, 'author_profile': 'https://Stackoverflow.com/users/729', 'pm_score': 1, 'selected': False, 'text': "<p>If you're looking for high performance, you are going to want to avoid paging completely, so the page file size becomes less significant.  Invest in as much RAM as feasible for the DB server.</p>\n"}, {'answer_id': 389036, 'author': 'ConcernedOfTunbridgeWells', 'author_id': 15401, 'author_profile': 'https://Stackoverflow.com/users/15401', 'pm_score': 2, 'selected': False, 'text': "<p>The bigger the better up to the size of the working set of the application where you will start to get into diminishing returns.  You can try to find this by slowly increasing or decreasing the size until you see a significant change in cache hit rates.  However, if the cache hit rate is over 90% or so you're probably OK.  Generally you should keep an eye on this on a production system to make sure it hasn't outgrown its RAM allocation.</p>\n"}, {'answer_id': 1403462, 'author': 'Brandon Wood', 'author_id': 423, 'author_profile': 'https://Stackoverflow.com/users/423', 'pm_score': 2, 'selected': False, 'text': "<p>We were recently having some performance issues with one of our SQL Server that we weren't able to completely narrow down, and actually used one of our Microsoft support tickets to have them help troubleshoot.  The optimal pagefile size to use with SQL Server came up, and Microsoft's recommendation is that it be <strong>1 1/2 times the amount of RAM</strong>.</p>\n"}, {'answer_id': 1780172, 'author': 'Remus Rusanu', 'author_id': 105929, 'author_profile': 'https://Stackoverflow.com/users/105929', 'pm_score': 5, 'selected': True, 'text': '<p>Irrelevant of the size of the RAM, you still need a pagefile at least 1.5 times the amount of physical RAM. This is true even if you have a 1 TB RAM machine, you\'ll need 1.5 TB pagefile on disk (sounds crazy, but is true).</p>\n\n<p>When a process asks MEM_COMMIT memory via VirtualAlloc/VirtualAllocEx, the requested size needs to be reserved in the pagefile. This was true in the first Win NT system, and is still true today see <a href="http://msdn.microsoft.com/en-us/library/ms810627.aspx" rel="noreferrer">Managing Virtual Memory in Win32</a>:</p>\n\n<blockquote>\n  <p>When memory is committed, physical\n  pages of memory are allocated <strong>and\n  space is reserved in a pagefile</strong>.</p>\n</blockquote>\n\n<p>Bare some extreme odd cases, SQL Server will always ask for MEM_COMMIT pages. And given the fact that SQL uses a <a href="http://msdn.microsoft.com/en-us/library/ms178145.aspx" rel="noreferrer">Dynamic Memory Management</a> policy that reserves upfront as much buffer pool as possible (reserves and <em>commits</em> in terms of VAS), SQL Server will request at start up a huge reservation of space in the pagefile. If the pagefile is not properly sized errors 801/802 will start showing up in SQL\'s ERRORLOG file and operations. </p>\n\n<p>This always causes some confusion, as administrators erroneously assume that a large RAM eliminates the need for a pagefile. In truth the contrary happens, a large RAM increases the need for pagefile, just because of the inner workings of the Windows NT memory manager. The reserved pagefile is, hopefully, never used.  </p>\n'}, {'answer_id': 3399842, 'author': 'Doctuh D.', 'author_id': 158789, 'author_profile': 'https://Stackoverflow.com/users/158789', 'pm_score': 2, 'selected': False, 'text': '<p>According to Microsoft, "as the amount of RAM in a computer increases, the need for a page file decreases." The article then goes on to describe how to use Performance Logs to determine how much of the page file is <strong>actually</strong> being used. Try setting your page file to 1.5X system memory for a start, then do the recommended monitoring and make adjustments from there.</p>\n\n<p><a href="http://support.microsoft.com/kb/889654" rel="nofollow noreferrer">How to determine the appropriate page file size for 64-bit versions of Windows</a></p>\n'}, {'answer_id': 6110648, 'author': 'Alex', 'author_id': 767720, 'author_profile': 'https://Stackoverflow.com/users/767720', 'pm_score': 1, 'selected': False, 'text': "<p>After much research our dedicated SQL Servers running Enterprise x64 on Windows 2003 Enterprise x64 have no page file.</p>\n\n<p>Simply, the page file is a cache for files that gets managed by the OS, and SQL has it's own internal memory management system.</p>\n\n<p>The MS article referenced does not qualify that the advice is for the OS running out-of-the-box services such as file sharing.</p>\n\n<p>Having a page file simply burdens the disk I/O because Windows is trying to help, when only the SQL OS can do the job.</p>\n"}, {'answer_id': 7668074, 'author': 'Robert L Davis', 'author_id': 372317, 'author_profile': 'https://Stackoverflow.com/users/372317', 'pm_score': 4, 'selected': False, 'text': "<p>With all due respect to Remus (whom I respect greatly), I strongly disagree. If your page file is large enough to support a full dump, it will perform a full dump every time. If you have a very large amount of RAM, this can cause a tiny blip to became a major outage.</p>\n\n<p>You do NOT want your server to have to write out 1 TB of RAM to disk if there is a one-time transient issue. If there is a recurring issue, you can increase the page file to capture a full dump. I would wait to do this until you have been isntructed by PSS (or someone else qualified to analyze a full dump) request you to capture a full dump. An extremely small percentage of DBAs know how to analyze a full dump. A mini-dump is sufficent for troubleshooting most issues that pop up anyway.</p>\n\n<p>Plus, if your server is configured to allow a 1 TB full dump and a recurring issue occurs, how much free disk space would you recommend having on hand? You could fill up an entire SAN in a single weekend.</p>\n\n<p>A page file 1.5*RAM was the norm back in the days when you were lucky to have a SQL Server with 3 or 4 GB of RAM. This is not the case any more. I leave the page file at Windows default size and settings on all production servers (except for an SSAS server that is experiencing memory pressure).</p>\n\n<p>And just for clarification, I've worked with servers ranging from 2 GB of RAM to 2 TB of RAM. After more than 11 years, I have only had to increae the paging file to capture a full dump one time.</p>\n"}, {'answer_id': 22851081, 'author': 'js5', 'author_id': 3495794, 'author_profile': 'https://Stackoverflow.com/users/3495794', 'pm_score': 1, 'selected': False, 'text': '<p>In this case, the normal recommendation of 1.5 times total physical RAM is not the best.  This very general recommendation is provided under the assumption that all memory is being used by "normal" processes, which can generally have their least-used pages moved to disk without generating massive performance issues for the application process the memory belongs to.</p>\n\n<p>For servers running SQL Server (generally with very large amounts of RAM), the majority of the physical RAM is committed to the SQL Server process and should be (if configured correctly) locked in physical memory, preventing it from being paged out to the pagefile.  SQL Server manages its own memory very carefully with performance in mind, using a large part of the RAM allocated to its process as a data cache to reduce disk I/O.  It does not make sense to page out those data cache pages to the pagefile, as the sole purpose of having that data in RAM in the first place is to reduce disk I/O.  (Note that the Windows OS also uses available RAM similarly as disk cache to speed up system operation.)  Since SQL Server already manages its own memory space, this memory space should not be considered "pageable", and not included in a calculation for pagefile size.</p>\n\n<p>In regard to MEM_COMMIT mentioned by Remus, the terminology is confusing because in the virtual memory parlance, "reserved" never refers to actual allocation, but to preventing use of an address space (not physical space) by another process.  Memory available to be "committed" is basically equal to the sum of physical RAM and pagefile size, and doing a MEM_COMMIT just decrements the amount available in the committed pool.  It does <em>not</em> allocate a matching page in the pagefile at that time.  When a committed memory page is actually written to, that is when the virtual memory system will allocate a physical memory page and possibly bump another memory page from physical RAM to the pagefile.  See MSDN\'s <a href="http://msdn.microsoft.com/en-us/library/aa366887.aspx" rel="nofollow">VirtualAlloc function</a> reference.</p>\n\n<p>The Windows OS keeps track of memory pressures between application processes and its own disk cache mechanism and decides when it should bump non-locked memory pages from physical to the pagefile.  My understanding is that having a pagefile that is way too large compared to the actual non-locked memory space can result in Windows overzealously paging out application memory to the pagefile, resulting in those applications suffering the consequences of page misses (slow performance).</p>\n\n<p>As long as the server is not running other memory-hungry processes, a pagefile size of 4GB should be plenty.  If you have set SQL Server to allow locking pages in memory, you should also consider setting SQL Server\'s max memory setting so that it leaves some physical RAM available to the OS for itself and other processes.</p>\n\n<p>802 errors in SQL Server indicate that the system cannot commit any more pages for the data cache.  Increasing the pagefile size will only help in this situation insofar as Windows is able to page out memory from non-SQL Server processes.  Allowing SQL Server memory to grow into the pagefile in this situation might get rid of the error messages, but it is counterproductive, due to the point earlier about the reason for the data cache in the first place.</p>\n'}]
['https://Stackoverflow.com/questions/2588', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/423/']