08 June, 2009

Exchange 2007 memory and hardware configuration best practices

A commonly repeated adage about Exchange Server memory is "more is better." The more memory you have, the less likely Exchange Server will experience bottlenecks and the faster things will run.


Exchange 2007 memory and hardware configuration best practices
Exchange 2007 is all the more powerful on systems with more than 4 GB of RAM, thanks to its 64-bit architecture. So it would seem to make sense to throw as much memory as is physically possible at a given 64-bit Exchange installation, right?
That's the theory, but the practice especially when it comes to Exchange Server 2007 is a little different.
In Microsoft's article about Exchange Server 2007 hardware, "Planning processor and memory configurations," there are a number of surprises regarding the best memory configurations for a 64-bit Exchange installation. One is the revelation that 32 GB is the most cost-effective memory configuration for Exchange 2007 boxes.
This is not a limitation of Exchange 2007, but an observation about how cost-effective that much memory in a given Exchange Server will be, and how expensive it is to buy the required hardware.
An Exchange 2007 system's memory bus architecture may impose speed limits based on how much memory is installed. A system with 16 GB of PC3200 memory can support 32 GB of memory, but only at PC2700 speeds (so having more memory may be offset by the fact that it's slower).
Another hardware consideration is that a given Exchange 2007 server may work better when more memory slots are filled vs. having denser memory modules in fewer slots.
Microsoft breaks down recommended memory allocations for Exchange 2007 servers based on their roles. For example, a mail server will probably need 2 GB plus 2 MB to 5 MB per mailbox, with a recommended maximum of 32 GB.

By those calculations, a 32 GB mail server could comfortably support over 6,000 users. Assuming heavy usage, 32 GB may be overkill for many organizations.
There are two caveats:
1. These estimates don't take into account third-party applications that might be running on the same Exchange server.
2. It assumes fairly sane mailbox usage i.e., you're not allowing people to have 5 GB mailboxes or something equally absurd.
For my own edification, I went to Dell's site to spec two separate servers: one that scaled to 64 GB of RAM and another that only scaled to 32 GB. The first had memory speeds that topped out at 400 MHz (DDR2). The second went up to 667 MHz (DDR2) and started at far less of a price.
Exchange Server memory management with /3GB, /USERVA and /PAE
Exchange Server is notorious for devouring server memory. In this tip, I explain how the /3GB switch, /USERVA switch and /PAE switch can help you manage Exchange Server 2003 memory and performance. I also share best practices you should employ so you don't cannibalize Windows Server 2003's memory in the process.

/3GB switch
By default, Windows Server 2003 can address up to 4 GB of memory. The server doesn't actually need to have 4 GB of RAM installed though. Virtual memory allows Windows Server 2003 to address a full 4 GB, even if there is considerably less memory installed.
Also by default, Windows splits the 4 GB of addressable memory right down the middle. It reserves 2 GB of memory space to the Windows operating system and 2 GB for user-mode processes (applications).
The /3GB switch alters the balance of address space allocation. If the /3GB switch is applied, Windows will only allocate 1 GB of address space for the operating system, and leave a full 3 GB of address space for user-mode processes.
Conventional wisdom has long stated that you should apply the /3GB switch to the BOOT.INI file for any server that has 1 GB or more of physical RAM. However, Exchange Server can be a demanding application, so the 1 GB rule may not always be what's best for Exchange Server.
According to Microsoft, you should only use the /3GB switch on Exchange servers that are hosting mailboxes or public folders. If an Exchange server is simply acting as a front-end server, bridgehead server, or performing some other role that doesn't involve hosting mailboxes or public folders, it's best to allow the operating system access to the full 2 GB memory address space. (Microsoft did make the default 2 GB for a reason.)
Some people at Microsoft have even suggested that the /3GB switch is best avoided unless Exchange Server is hosting more than 20 mailboxes.
Microsoft also discourages the use of the /3GB switch if you are running Exchange Server on Windows 2003 Small Business Server, or if Exchange Server is running on a domain controller (running Exchange Server on a domain controller is not recommended).
The primary reason for not using the /3GB switch in some situations is that the Windows operating system makes page table entries (PTEs) for allocating memory. Windows has a finite amount of space that it can use for PTEs, and using the /3GB switch significantly reduces the space available for them.
If PTE space drops below a certain level, Windows has a tendency to become unstable. So it's often wise to provide the operating system with the full 2 GB of address space, unless Microsoft Exchange is the server's sole application and Exchange Server is hosting mailboxes and/or public folders.

/USERVA switch
You can provide Windows with more PTE space while still using the /3GB switch through the use of a BOOT.INI switch available in Windows Server 2003 called /USERVA.
The /USERVA switch can be used in conjunction with the /3GB switch to increase the available PTE space. For example, using the /USERVA switch with a value of 3030 (/USERVA=3030) will allocate an additional 42 MB of space to the PTEs.
It's worth pointing out though that Microsoft does not support arbitrary /USERVA values. Some applications actually have a documented /USERVA setting, but Exchange Server does not. That being the case, you will have to determine the appropriate /USERVA value by monitoring the Free System Page Table Entries counter in Performance Monitor.
With the /USERVA switch, lower numbers create more PTE space. Therefore, a value of 3,000 would create more PTE space than a value of 3,030. 3,030 is a good starting point, but if the System Page Table Entries counter drops below 7,000, it means that the system is not stable and there aren't enough PTEs available. You will then have to set the /USERVA value to a lower number to correct the problem.
According to Microsoft, the absolute lowest number that you can use as a /USERVA value is 2,800. But Microsoft also reports that it has yet to see an Exchange Server installation require a /USERVA value of lower than 2,900.

/PAE switch
Some higher end servers support using more than 4 GB of RAM. If you have such a server and you are running Windows Server 2003 Enterprise Edition or Datacenter Edition, you can use the /PAE switch with the BOOT.INI file.
The /PAE switch tells Windows Server 2003 to use page translation to allow a 32-bit system to address more than 4 GB of memory (this is not necessary on 64-bit servers).
Using the /PAE switch allows more memory to be allocated to Exchange Server. But like the /3GB switch, the /PAE option also consumes PTE space.

The /3GB and the /PAE switches should never be used together under any circumstances.


Please let me know if this post was helpful.

No comments:

Post a Comment