分类: WINDOWS
2008-08-06 12:18:59
在开启该参数后,并将测试客户端增加到9个的时候,每个客户端模拟560个用户去尝试发送邮件操作,测试发现内存使用情况是非线性增长的,在最初的1G的增长时间,仅仅使用了20分钟左右,然后每分钟增长1.8M左右。当增长到1.3G左右,以后的增加将非常的缓慢。
在后来增加测试用户数目后,Domino服务器出现不能响应和宕机的情况,后来根据宕机搜集到的日志来分析,得出如下的结论。
Ø 首先加入的/3GB参数已经起效。从nsd log中看到domino进程能够访问到0x7FFFFFFF以上的内存地址和象0xaefe0000这样高的内存地址。从memcheck看也显示了domino可用的内存限制达到了2.7GB,如下所示:
<@@ ------ System Data ->
Performance Data -> Process Memory Mappings (summary) :: [ nserver: 0264] (Time 17:41:28) ------ @@>
COMMIT RESERVED TOTAL
PRIVATE: 151.5M 98.1M 249.6M
MAPPED: 1.6G 4.6M 1.6G
IMAGE: 44.6M 0.0K 44.6M
TOTAL:
1.8G 102.7M 1.9G
Totals: Used=
1.9G, Free=847.7M, Fragmented=100.8M, Overall= 2.7G, maxFree= 0.0K,
Limit=aefeffff ( 2.7G)
> > |
Lotus Domino support for the Windows /3GB switch |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Question | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
On the Windows® 32-bit platform, heavily loaded Domino® servers, or servers with complex application designs may experience crashes due to high memory usage. More specifically, a specific process may reach the limit of its user address space. By default on Windows 32-bit, the users' address space is 2 gigabyte (GB) in size. This limit can be quickly reached on heavily loaded Domino servers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cause | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The 4 GB address space limit is inherent to any 32-bit application.
Installing more RAM, CPU or disk will not overcome this limit. The
portion of the 4 GB address space given to the user mode (referred to
as the user address space) is platform dependent. On W32, by
default, the user address space is 2 GB, with the kernel reserving a
separate 2 GB, resulting in a total of 4 GB of address space.
With ever increasing memory demands by complex Enterprise applications such as Domino, the 2 GB user address space can quickly become saturated, resulting in errors or crashes. This can become especially pronounced in cases where multiple enterprise components operate under one process, such as Domino, Oracle, and Java™. In these cases, it is possible to increase the user's address space size to 3 GB using the /3GB boot.ini switch for certain releases of Windows. Does IBM® Lotus® recommends this course of action? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Answer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Before we provide the , it is important to provide the proper context for this discussion.
On certain W32 platforms, it is possible to change the default percentages of the virtual address space by using the boot.ini parameter /3GB. Using the /3GB switch changes the split of the total virtual address space so that the user address space is increased to 3 GB, and the kernel address space is decreased to 1 GB. This setting in no way changes the overall virtual address space size (the process still only had 4 GB total), and it does not have an impact on how much virtual memory is managed by the system. The /3GB switch simply changes the split between user and kernel space for each process. Below is a table that provides a list of W32 releases with
which the /3GB switch is compatible. This information was taken from
the Microsoft Article “Memory Support and Windows Operating Systems”:
There are various implications when using this switch that must be considered, both application level (Domino) and kernel level (Operating System) factors:
Application (Domino) Level - The /3GB switch has its uses; however, even with this kernel-level setting enabled, a 32-bit process will not be able to use more than 2 GB user space unless it is compiled with the /LARGEADDRESSAWARE switch. This parameter must be specified when compiling the 32-bit executable. If the kernel is configured with the /3GB setting, but an exe is not compiled with the Large Address Aware option, then the process’ user address space will still be restricted to 2 GB. Contrary to logic, the additional 1 GB is not given back to the kernel, but is instead flagged as a reserved block within the user address space. The result is that 1 GB of the virtual address space is lost. Hence, the /3GB switch should only be used if the process in question is compiled with /LARGEADDRESSAWARE. Misuse of the /3GB setting can cause more problems than it solves. Beginning in Domino 7.0.1, the Domino server is compiled to be Large Address Aware, so that it can make use of the additional address space up to the full 3 GB. From an application-level perspective, this is all that is required to use the additional 1 GB of address space.
Kernel Level - The application level is not the only consideration. There is a far more important set of implications regarding kernel level performance. When the /3GB switch is used on W32, in actuality, one GB of the kernel's address space is taken, and given back to the user address space. This means the kernel's address space is cut in half. While certain complex applications may need the extra room in their process address space, the drawback to using this switch is that the kernel must compress its memory usage into the remaining one GB. This will affect all processes system-wide, not only those that use the full 3 GB of user space, since it is the system that is booted into /3GB mode, and the kernel address space is shared across all processes. This can and will have substantial performance implications, particularly for certain kernel components such as the paged-pool, non-paged pool, and the System Page Table Entries (PTE). Specifically, the use of /3GB will reduce the paged pool maximum size for Windows 2003 from 470 MB to below 200 MB. As default 80% page pool policy, the average paged pool would be around 160 MB, which is far below what is normally expected or desired, as Domino consumes a single 1 KB paged pool for each 1 MB database opening. In the worst scenario, Windows OS might log Event ID - 2020, or Domino might intermittently report the error "Hardware/OS error (Insufficient system resources exist to complete the requested service)." In addition, when enabling the /3GB switch on Windows 32-bit, Lotus Domino performance testing indicates between a 10-15% increase in CPU usage (due to additional overhead from the constrained kernel). Domino testing indicates that this feature scales better under Windows 2003 than it does under Windows 2000.
Microsoft generally recommends that you keep the range
of the /userva switch to between 2900 MB and 3030 MB. However, Domino
performance testing indicates that a value of /userva=2800 works well.
Again, this is only an option for Domino 7 and higher. For more
information regarding the use of the /userva switch, see the following
Microsoft article:
The fact that a process' user address space is increased to 3 GB
does not mean that it will use 3 GB of RAM. It simply means that the
process can allocate and access up to 3 GB of virtual memory.
In fact, under the hood, the kernel makes the decision as to what data
is paged out to disk, and what stays in RAM. The kernel is very
conservative about what stays in RAM. So, in reality, very few pages in
a process' user address space reside in RAM at any one time.
The use of the /PAE setting does NOT affect the size of the virtual address space for each 32-bit application, but only affects the total amount of RAM that the kernel/CPU can manage system-wide. To summarize: • /3GB affects the virtual user address space of each process • /PAE affects the amount of RAM that can be managed by the OS The /PAE switch affects the amount of RAM that the CPU can address. The use of page file is not affected by this switch, since the page file is stored sequentially on disk. A system may commit far more than 4 GB of virtual memory (across all processes) without the /PAE switch enabled, where most of this memory usage is in the form of the page file, and where only a portion of RAM is in use. By its nature, the kernel can manage the full amount of RAM, and can allow the total virtual memory usage across all 32-bit applications to exceed far greater than 4 GB. In other words, you don’t need to have the /PAE switch enabled to commit more than 4 GB of total virtual memory (the sum of RAM and page file), but only if you want to make use of more than 4 GB of RAM across all processes. Below is a table that provides RAM limits (using /PAE) for various versions of Windows Operating Systems. This information was taken from MSDN articles Q283037 and Q292934:
…A program that requests 3 GB of memory is more likely to be able to have more of its memory remain in physical memory rather than be paged out, which increases the performance of programs that are capable of using the /3GB switch. The exception is when the /3GB switch is used in conjunction with the /PAE switch, the operating system does not use any memory in excess of 16 GB. This behavior is caused by kernel virtual memory space considerations. Thus, if the system restarts with the /3GB entry in the Boot.ini file, and the system has more than 16 GB of physical memory, the additional physical random access memory (RAM) is not used by the operating system…
In cases where a server is crashing due to the 2 GB limit, there are various options available:
Below is a table which has been taken and modified from Microsoft article #294418. For more information, please refer to the Microsoft article titled "Comparison of 32-bit and 64-bit memory architecture for 64-bit editions of Windows XP and Windows Server 2003" (see link below)
Comparison of 32-bit and 64-bit memory architecture for 64-bit editions of Windows XP and Windows Server 2003 Large memory support is available in Windows Server 2003 and in Windows 2000 How to use the /userva switch with the /3GB switch to tune the User-mode space to a value between 2 GB and 3 GB Memory Support and Windows Operating Systems Windows 2000 Datacenter Server Does Not Locate Memory Greater Than 16 GB Use of the /3GB switch in Exchange Server 2003 on a Windows Server 2003-based system Server is unable to allocate memory from the system paged pool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||