Friday, November 26, 2010

2000: Enabling large memory support

Self experience:
Platform: SQL 2000 ENTERPRISE SP3a @ Windows Server 2003 R2 Standard SP2 (4GB Physical RAM)
"/3GB" added to boot.ini
Perfmon counter: SQLServer:MemoryManager \ Total Server Memory (KB):
...before awe enabled: ~2.7GB
...after awe enabled: ~3.5GB
---

Find the (available) amount of memory available to SQL Server (instance / machine)
Note to self:
Strange result on SQL 2000 Standard SP3a @ Windows Server 2003 R2 Standard SP2:
------------------------ begin --------------------------
(20 row(s) affected)

Name;Physical_Memory_In_MB;Physical_Memory_In_Bytes
PhysicalMemory;4056;4056 (4253089792)

(1 row(s) affected)

value;config;comment;status
0;1543;Minimum size of server memory (MB);3
2147483647;1544;Maximum size of server memory (MB);3

(2 row(s) affected)
------------------------ end --------------------------
Notice that "Maximum size of server memory (MB)" is 3 (means 3 MB??)
---

ATTENTION:
AWE is not available on all versions of SQL Server 2000. For example, AWE is not available for MSDE, SQL Server 2000 Standard Edition
source:
FIX: Not all memory is available when AWE is enabled on a computer that is running a 32-bit version of SQL Server 2000 SP4
Similar info:
SQL Server 2000 "Standard  Edition" is limited to 2GB of RAM, this has nothing to do with the /3GB switch.  To use more than 2GBs, you must be running "Enterprise Edition"
source: SQL Server 2000 Standard Edition Memory limit with 3GB Switch
---

To use Address Windowing Extensions (AWE) memory, you must run the SQL Server 2000 database engine under a Windows account that has been assigned the Windows lock pages in memory administrative credentials.
Related article:
You may not be able to connect to a SQL Server that is running on a Windows Server 2003 computer by using Windows authentication
http://support.microsoft.com/kb/840219
Look for word: SeLockMemoryPrivilege
The local System account has the 'lock pages in memory' privilege by default.
www.go4answers.com/Example/enable-awe-sql-account-local-system-37743.aspx

Normally, both the SQL Server 2000 Enterprise Edition and SQL Server 2000 Developer Edition can use up to 2 GB of physical memory. With the use of the AWE enable option, SQL Server can use up to 4 GB of physical memory.

The maximum amount of memory that can be supported on Windows Server 2003 is 4 GB. However, Windows Server 2003 Enterprise Edition supports 32 GB of physical RAM. Windows Server 2003 Datacenter Edition supports 64 GB of physical RAM by using the Physical Address Extensions (PAE) feature. You can use the 3 GB switch that is in the Boot.ini file with Microsoft Windows Server 2003, Microsoft Windows Server 2003 Enterprise Edition, or with Microsoft Windows Server 2003 Datacenter Edition.

Source:
How to configure SQL Server to use more than 2 GB of physical memory
http://support.microsoft.com/kb/274750
---
How to tell if PAE is enabled?
Open System Properties > General > look for label "Physical Address Extension" under RAM size info
---
A processes' VAS in 32bit windows is 4GB in size

if there isn't enough physical memory space available for the OS to store all the committed memory for all applications running on the machine, this is where the page/swap file comes in

Use of the /3GB and /USERVA switches does NOT depend on using /PAE or AWE - you do NOT need /PAE enabled to use these switches, and you don't need AWE enabled either - these options are mutually exclusive. You can use either of these switches on servers with less than 4gb style="color: black; background-color: rgb(255, 255, 102);">PAE in a nutshell allows the OS to see more than 4GB of physical memory - remember above in the memory architecture

Adding the PAE switch has NO effect whatsoever on the VAS size in a 32bit system - it remains at 4GB in total

what enabling PAE would in effect do for a system (assuming more than 4GB of memory exists before and after the change that is) would be to allow the OS more physical memory space for storing data instead of having to page this data to disk

AWE is basically a set of system API's that allow a process to access memory outside/larger than it's VAS

/3GB or /USERVA should only be used if you can properly determine that your workload is VAS-pressured (and none of the other considerations preclude the use as well) - if your workload is not under VAS pressure, or if the VAS is not your bottleneck, you will probably see minimal (if any) increased throughput.
Related article:
How to find who is using / eating up the Virtual Address Space on your SQL Server
http://blogs.msdn.com/b/sqlserverfaq/archive/2010/02/16/how-to-find-who-is-using-eating-up-the-virtual-address-space-on-your-sql-server.aspx

Source:
PAE and /3GB and AWE oh my...
http://blogs.msdn.com/b/chadboyd/archive/2007/03/24/pae-and-3gb-and-awe-oh-my.aspx
---
AWE is is an enabler allowing a 32-bit Operating System to address more than 4GB of physical memory.; there are obvious benifits however, there are performance considerations which should not be over looked when using AWE. For example, AWE memory cannot be swapped to the page file, therefore you should closely monitor application memory requirements after machine startup before allocating memory

Source:
SQL : Enable AWE on i386/x86
http://cb-net.co.uk/index.php?option=com_content&view=article&id=85:sql-enable-awe-on-i386x86&catid=13:sql&Itemid=3
---
Enabling AWE Memory for SQL Server
http://msdn.microsoft.com/en-us/library/ms190673.aspx
---
Since Windows 2000, the operating system has provided a feature to reduce the kernel mode memory to just 1GB, thereby allowing the user mode portion 3 of the 4GB in the virtual address space. Microsoft achieves this by the system-wide boot.ini /3GB switch and it applies to all 32-bit applications running on the box (not just SQL Server). Windows 2003 has introduced a new boot.ini switch, /USERVA (see http://support.microsoft.com/?kbid=316739), which essentially does the same thing as /3GB but allows finer tuning of exactly how much memory is allocated to the kernel code (between 1GB and 2GB).

(See also configuration matrix for different RAM amount)

Source:
Memory Use in SQL Server
http://sqlnerd.blogspot.com/2006/07/memory-use-in-sql-server.html

No comments:

Post a Comment