| United States-English |
|
|
|
![]() |
HP-UX System Administration Tasks: HP 9000 > Chapter 6 Managing Swap Space and
Dump Areas Designing Your Swap Space Allocation |
|
When designing your swap space allocation:
Available swap on a system consists of all swap space enabled as device and file system swap. To find how much swap space is presently available on your system and how much is being used, use SAM or run the command swapinfo. The output of swapinfo tells you the type of swap by location, how much of it is available, how much is used, how much is free, and how much is reserved but not allocated. For more information, refer to swapinfo(1M). Your swap space must be large enough to hold all the processes that could be running at your system's peak usage times. If your system performance is good, and, in particular, if you are not getting swap errors such as Out of Memory or those to the effect that a process was killed due to no swap space, then your system has adequate swap space. Typically, unless the amount of physical memory on your system is extremely large, the minimum amount of swap space should equal the amount of physical memory on the system. Generally, a rule of thumb is to make swap space to be roughly two to four times your physical memory. Swap space usage increases with system load. If you are adding (or removing) a large number of additional users or applications, you will need to re-evaluate your swap space needs.
Once you know or suspect that you will have to increase (or decrease) your swap space, you should estimate your swap space requirements. The following section describes one method. You can estimate the amount of swap space you need by adding the space required by the applications you expect to run on your system to the amount of physical memory you have. If you do not know the amount of physical memory on your system, you can enter:
Look for the output line beginning:
Divide the value of xxxxx (which is in KBs) by 1024 to obtain the value in MBs. Or, if your system currently has sufficient swap space, then you can increase swap space levels to accommodate new applications. Use the following worksheet to estimate the size needed for your swap space. Remember, 1KB = 1024 bytes. For standalone (a server or otherwise) and client systems that will swap to local swap space either to a device or a file system, you can estimate your swap space needs as follows: 1. Enter the amount of the physical memory currently on the local machine. At a minimum, swap space should equal that amount. Enter the amount in KBs. — — — — 2. Determine the swap space required by your largest application (look in the manual supplied with your application or check with the manufacturer; 1MB = 1,024KBs = 10,248 bytes). If you will be running several applications concurrently, you should add their swap space requirements together. — — — — TOTAL local swap space needed (in KBs): sum of 1 and 2 — — — — For a system that has local swap and also serves other systems with swap space, make a second estimation in addition to the one above. 1. Include the local swap space requirements for the server machine, based on the estimation from above. — — — — 2. Add up the total swap space you estimate each client requires. At a minimum, this number should equal the sum of physical memory for each client. — — — — TOTAL server swap space (in KBs):sum of 1 and 2 — — — — The default maximum amount of swap space you can configure, for both device swap and file system swap combined, is approximately 512MB. The tunable system parameter maxswapchunks controls this maximum. The parameter maxswapchunks (default value of 256) limits the number of swap space chunks. The default size of each chunk of swap space is 2MB. For example, when the value of the parameter maxswapchunks is 256, the maximum configurable device swap space (maxswapchunks x swchunk x DEV_BSIZE) is:
If you need to increase the limit of configurable swap space beyond the default, increase the value of the maxswapchunks operating system parameter either by using SAM (which has more information on tunable parameters) or reconfigure the kernel using HP-UX commands as described in Chapter 1. The parameter swchunk is also tunable.
When you need more swap space and you have no devices available for additional device swap, or if you need to swap to a remote system, you can dynamically add file system swap to your system. Use the following guidelines:
When you add swap areas, you can assign a priority to each. Priorities range from 0 (the highest) to 10 (the lowest). The system uses the swap areas with higher priority first. The system gives device swap priority over file system swap when each has the same priority. Here are the guidelines you should use:
The primary swap area has priority 1. Device and file system swap areas set dynamically default to a priority of 1 if no priority is specified. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||