Optimizing AIX 7 memory performance: Part 1, Memory overview and tuning memory parameters

Skill Level: Intermediate Ken Milberg Writer/site expert Future Tech Martin Brown (mc@mcslp.com) Freelance Writer Author

02 Nov 2010 AIX® 7 takes advantage of the POWER7 CPU to improve memory usage within LPARs. While memory tuning might be more difficult to implement than processor or disk tuning, it is no less important. You can do more to tune memory on an AIX 7 server than on any other subsystem. Changing some memory parameters on your system can increase performance dramatically, particularly when these parameters are not optimized for the environment which you are running. This three-part series on memory tuning dives right into tuning parameters focusing on the many challenges and the various best practices of optimizing memory performance, and it also discusses some improvements in AIX 6 and AIX 7. Part 1 provides an overview of memory on AIX 7, including a discussion of virtual memory and the Virtual Memory Manager (VMM).

Introduction
As a systems administrator, you should already be familiar with the basics of memory, such as the differences between physical and virtual memory. What you might not fully understand is how the Virtual Memory Manager (VMM) works in AIX® 7 and how it relates to performance tuning. In AIX 7, it is also worth considering the effect of virtual memory and how it is used and applied within workload partitions (WPAR). This article looks at some of the monitoring tools you can use to tune your systems and outline some of the more important AIX 7 memory management

Part 1, Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. All rights reserved.

Trademarks Page 1 of 13

and it is running well (rather than when your users are screaming about slow performance). We discuss how AIX 7 uses virtual memory to address more memory than is physically on your system. the default size per page is 4KB. It implements a process of early allocation of paging space. although this can be changed. even when there is plenty of physical memory left on the system. Using this method. To help validate the findings. and data should be captured and analyzed as quickly as possible after that change to determine what difference. Depending on the type of system you are running. POWER5+ or later can also use 64KB. can optimize memory performance on your box. and 16GB page sizes. Further. is tuning systems—you should always think of it as an ongoing process.developerWorks® ibm. let's use a specific example and discuss some best practices for setting these parameters. the VMM needs to allocate space. Any discussion of memory and AIX 7 must start with a description of the VMM. The 16MB page size is known as large and the 16GB page size as huge. but it can be altered to different ranges depending on the processor environment being used. Memory overview This section gives an overview of memory as it relates to AIX 7. the VMM plays a vital role in helping manage real memory. including how the virtual memory manager operates and the effects of the dynamic variable page size. as they apply to your systems environment. In AIX 7. Tuning one or two parameters on the fly. The best time to start monitoring your systems is when you have first put your system in production. When RAM is accessed. regardless of which subsystem you are looking to tune.com/developerWorks systems. All rights reserved. Here is how it works. the reward is often greater. For AIX 7. not just virtual memory. The implementation of these enhancements. The POWER4 architecture can also support the 16MB page size. One area that does not change. Part 1. not just virtual memory. the change really made. You can never really be sure if there is a problem without a real baseline of what the system looked like when it was behaving normally. We also explain how the Virtual Memory Manager (VMM) actually works and how it services requests. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. in some cases. only one change should be made at a time. both have use cases for very large memory applications. AIX newbies are sometimes surprised to hear that the VMM services all memory requests from the system. While you might find tuning your memory to be more difficult than other subsystems. all virtual memory segments are partitioned into pages. Trademarks Page 2 of 13 . The default page size is 4KB per page. if any. 16MB. can make a significant difference in the overall performance of your system. there might also be specific tuning recommendations that should be set on your systems.

instead of many smaller chunks. File memory File memory (unlike computational memory) uses persistent segments and has a permanent storage location on the disk. both the physical and paging spaces are released in many cases. given the choice between RAM and paging space. VMM also maintains what is referred to as a free list. Allocated pages can be either RAM or paging space (virtual memory stored on disk). Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. you can actually see this happening while monitoring your system. Computational memory Computational memory is used while your processes are actually working on computing information. What VMM also does is classify virtual memory segments into two distinct categories. When a process terminates. most people would prefer to use physical memory. which is defined as unallocated page frames.ibm. When there is a large spike in available pages. Tuning of VPSS can be managed using the vmo tuning tool. AIX 7 uses all available memory. The virtual memory pages whose page frames are to be reassigned are selected using the VMM's page replacement algorithm. When free physical memory starts getting low. except memory that is configured to be unallocated and known as the free list. There are usually a very small amount of unallocated pages (which you configure) that the VMM uses to free up space and reassign the page frames to. collecting different segments of 4KB pages to make 64KB pages. Obviously. with different applications making use of different page sizes. Trademarks Page 3 of 13 . From here. you can determine that its objectives are to help minimize both the response time of page faults and to decrease the use of virtual memory where it can. if the RAM is available. All rights reserved. These working segments are temporary (transitory) and only exist up until the time a process terminates or the page is stolen. the purpose of VMM is to manage the allocation of both RAM and virtual pages. It is extremely important to understand the distinction between the two. The categories are working segments using computational memory and persistent segments using file memory. Data files or executable programs are Part 1. These are used to satisfy page faults. which means that the system will use larger pages as the application requests larger chunks of memory. This improves performance by allowing the application to access the memory in larger single chunks. pages can be dynamically resized. variable page size support (VPSS) was introduced. as this helps you tune your systems to their optimum capabilities. In addition. They have no real permanent disk storage location. programs that have not used recently are moved from RAM to paging space to help release physical memory for more real work. This paging algorithm determines which virtual memory pages currently in RAM ultimately have their page frames brought back to the free list. The different page sizes can be mixed within the OS concurrently. To reiterate. The pages can be dynamically resized from 4KB to 64KB.com/developerWorks developerWorks® For POWER6.

developerWorks® ibm. so you can enable it for your database partition and keep more data read from disk in memory. JFS2. Given the alternative. Active memory expansion In addition to the core memory settings and environment. This will lead to a recommendation for the compression ratio to be used within the LPAR. or a file is unlinked. but disable it for web servers. VMM is constantly lurking and working in the background trying to steal frames that have not been recently referenced. You should run amepat with a given interval (in minutes) and the number of iterations. You can see a sample of this in Listing 1. that is. if your LPAR has been granted 2048MB you can specify a compression ratio of 2. AIX 7 automatically adjusts the size of the two pools according to the workload and configuration of the logical partition. All rights reserved. AME compresses data within memory. heavy text applications may benefit from higher ratios). which could cause other pages to page out again. To prevent all information being compressed. memory is split into two pools. VMM actually has a memory load control algorithm. you can use the amepat command to monitor and determine the possible compression ratio with your given workload. which can occur when memory is extremely low and pages are constantly being paged in and out to support processing. as the kernel becomes too concerned with making room for pages than actually doing anything productive. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. AIX 7 can take advantage of the power of the POWER7 CPU to provide active memory expansion (AME). Trademarks Page 4 of 13 . which can detect if the system is thrashing and actually tries to remedy the situation.0 and be given an effective memory capacity of 4096MB. and reduce the amount of page swapping to disk as data is loaded. The compression amount is defined using a compression ratio. Unabashed thrashing can literally cause a system to come to a standstill. It also helps detect thrashing. or NFS. most people would much rather have file memory paged to disk rather than computational memory.com/developerWorks mapped to persistent segments rather than working segments. a compressed pool and an uncompressed pool. it must be paged. Part 1. They remain in memory until the file is unmounted. The configuration of AME is based on individual LPARs. while you run your normal applications in the background to collect the necessary information. such as JFS. VMM controls when these pages are overwritten or used to store other data. The data files can relate to filesystems. using the page replacement algorithm discussed earlier. After the data file is copied into RAM. allowing you to store keep more data in memory. a page is stolen. where the information stored in memory is swapped regularly. When a process references a page which is on disk. Because different applications and environments are capable of different compression ratios (for example.

All rights reserved.10 Expansion Factor --------1.00 [ 0%] Active Memory Expansion Recommendation: --------------------------------------The recommended AME configuration for this workload is to configure the LPAR with a memory size of 1.00 KB [ 0%] 256.00 GB Achievable Compression ratio :2.00 physical processors. If there is a change in the workload's utilization level or a change in workload itself.04 [ 4%] 1628 [ 79%] 1895 [ 93%] 1285 [ 63%] 243 [ 12%] 337 [ 16%] : Active Memory Expansion Modeled Statistics ------------------------------------------Modeled Expanded Memory Size : 2. This will result in a memory gain of 14%.com/developerWorks developerWorks® Listing 1. and the estimated overall peak CPU resource required for the LPAR is 0. Getting Active Memory Expansion statistics Command Invoked Date/Time of invocation Total Monitored time Total Samples Collected System Configuration: --------------------Partition Name Processor Implementation Mode Number Of Logical CPUs Processor Entitled Capacity Processor Max.14. Capacity True Memory SMT Threads Shared Processor Mode Active Memory Sharing Active Memory Expansion System Resource Statistics: --------------------------CPU Util (Phys.04 physical processors.00 [ 0%] 0. NOTE: amepat's recommendations are based on the workload's utilization level during the monitored period.ibm. the estimated CPU usage due to AME is approximately 0. The actual CPU usage used for AME may be lower or higher depending on the workload.00 MB [ 14%] CPU Usage Estimate ----------0. With this configuration.00 GB 1. You can monitor the current compression within a configured LPAR using the svmon tool. Listing 2. The modeled Active Memory Expansion CPU usage reported by amepat is just an estimate. amepat should be run again. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010.00 1.14 Modeled True Memory Size ------------2. Using svmon to get compression stats Part 1.75 GB and to configure a memory expansion factor of 1. Processors) Virtual Memory Size (MB) True Memory In-Use (MB) Pinned Memory (MB) File Cache Size (MB) Available Memory (MB) : amepat 1 1 : Fri Aug 13 11:43:45 CDT 2010 : 1 mins 5 secs : 1 : : : : : : : : : : l488pp065_pub POWER7 4 0. Trademarks Page 5 of 13 .75 GB Modeled Memory Gain -----------------0.00 GB 4 Enabled-Uncapped Disabled Disabled Current ---------------0. as shown here in Listing 2.00 2.25 1.

In AIX 7.4 CPSz CPFr txf cxf CR 106.07 18. Look for the true memory size in the output of different tools to determine the actual memory available without compression. particularly with respect to its System Global Area (SGA). This is because Oracle uses a lot of virtual memory. Therefore. The command in Listing 3 allocates 16777216 bytes to provide large pages with 128 actual large pages. along with some of the key parameters you need to be aware of. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. or an Oracle® database. Trademarks Page 6 of 13 .35 512. which is used to cache table data. and the system starts to use memory that cannot be created out of compression.00 1. not the actual memory size. Tuning Let's examine the tools that can allow you to tune the VMM to optimize performance for your system. the configured memory multiplied by the compression ratio). can benefit when using large pages. All rights reserved. among other things. the vmo tool is responsible for all of the configuration of the tunable parameters of the VMM system.91 142. Here is an example of an environment where you want to tune parameters using a certain type of methodology. as it shows the deficit in expanded memory.96 388. One other artifact of AME is that the memory sizes displayed by most tools.7 2.com/developerWorks # svmon -G -O summary=longame.00 17. Deficits occur when the compression ratio specified cannot be achieved. Altering the page size provides the most immediate performance improvement and is due to the reduction of Translation Lookaside Buffer (TLB) misses.00 607. including vmstat and others. typically show the expanded memory size (for example. which occurs because the TLB can now map to a much larger virtual memory range.developerWorks® ibm. in high performance computing (HPC). Allocating bytes # vmo -r -o lgpg_size=16777216 lgpg_regions=128 Part 1. This replaces the old vmtune tool available in AIX 5. For example. either Online Transaction Processing (OLTP) or a Data Warehouse application.unit=MB Unit: MB Active Memory Expansion -------------------------------------------------------------------Size Inuse Free DXMSz UCMInuse CMInuse TMSz TMFr 1024.50 The DXMSz column is the important one here.82 274. Listing 3. you need to be careful about over specifying the compression ratio.56 219.46 2.

you do not want to page working segments. you now leave strict_maxperm and strict_maxclient at their default numbers. lru_file_repage was first introduced in AIX Version 5.2 with ML4 and on ML1 of AIX Version 5.ibm. so you need to change it. If strict_maxperm were changed to 1. it could steal both file and computational pages. >80) and makes sure the lru_file_repage parameter is set to 0. the old approach to tuning your minperm and maxperm parameters was to bring maxperm to an amount <20 and minperm to <=10. then the page replacement would only steal file pages. The new approach sets maxperm to a high value (for example. This is how you would have normally tuned your database server. Based on this methodology.3.com/developerWorks developerWorks® If you want to use large pages in combination with shared memory. which is often used in HPC and database applications. Setting these parameters determine the appropriate value for your system to ensure that it is tuned to either favor computational memory or file memory. as doing so causes your system to page unnecessarily and decrease performance. Let's not lose sight of the fact that the primary reason you need this value tuned is because you want to protect the computational memory. This can change if your numperm is less than the minperm or greater than the maxperm. If it was between both. Setting tuning parameters vmo -p -o minperm%=5 vmo -p -o maxperm%=90 vmo -p -o maxclient%=90 Although you used to have to change these parameters. then you would start to steal from persistent storage. Trademarks Page 7 of 13 . When it falls below minperm. The way it worked in the past was actually quite simple: If your file pages (numperm%) were greater than the actual maxperm%. That has all changed. then it would only steal file pages. which is why you would now want maxperm to be high and minperm to be low. it would place a hard limit on the amount of Part 1. Listing 4 sets these critical tuning parameters. Another way of looking at this is if your numperm is greater than the maxperm. The default setting is 1. so you want to stop it. then you would now make the mistake of stopping the application caching programs that are running. In most cases. Getting back to the example. Listing 4. and using AIX 7 file caching for this purpose only causes confusion. you will also need to set the v_pnshm value: # vmo -p -o v_pinshm=1. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. it tells VMM that you prefer that it steal only file pages rather than computational pages. This parameter indicates whether or not the VMM re-page counts should be considered and what type of memory it should steal. All rights reserved. If you were to reduce the maxperm in this scenario. The most important vmo settings are minperm and maxperm. When you set the parameter to 0. Oracle uses its own cache. unless the number of file repages was greater than the amount of computational pages.

as you would prefer not to use AIX 7 file caching. which is not good. A value of 2 allows the VMM to use multiple page sizes per segment and is the default for all new installations. Once the application has been allocated 16 4KB blocks. respectively. A value 1 allows the VMM to use all the page sizes supported by the processor. Two configurable parameters control how VPSS operates. If the number of pages on your free list falls below the minfree parameter. because changing the lru_file_repage parameter is a far more effective way of tuning. A value of 0 indicates that only the 4KB and 16MB page sizes are supported. assuming all the blocks are in current use. they are promoted to be a single 64KB block. configured with vmo. These days it is unnecessary. Two other important parameters worth noting here are minfree and maxfree. Listing 5. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. the vmm_default_pspa parameter controls how many sequential pages are required for the smaller 4KB pages to be promoted to the 64KB page size. In this case. The default Part 1. we recommend these settings.3 to 960 and 1088. Trademarks Page 8 of 13 . and worse. the default values of minfree and maxfree were bumped up in AIX Version 5. Some applications. you would commonly see your free list at 120 or lower. which you can manually change using the commands in Listing 5. The vmm_support tunable.developerWorks® ibm. which led to more paging than was necessary.2 or lower. VMM starts to steal pages (just to add to the free list). sets how the VMM operates. All rights reserved. you can use the vmm_default_pspa parameter to specify that less than 16 4KB pages are required for promotion.com/developerWorks memory that could be used for persistent file cache. This process is repeated for as many 16-count sequences of 4KB blocks as the application is using. If you are running AIX Version 5. To address this issue. particularly those that use a lot of memory. With the multiple page size support enabled. may perform better with a 64KB page size even though they don't use full 64KB pages. expressed as a percentage. threads needing free frames were actually getting blocked because the value would be so low. This is done by making the maxperm value the upper limit for the cache. In older versions of AIX when the default minfree was set at 120. It continues to do this until the free list has at least the number of pages in the maxfree parameter. Setting the minfree and maxfree parameters manually vmo -p -o minfree=960 vmo -p -o maxfree=1088 Configuring variable page size support VPSS works by using the default 4KB page size. The first is simply enabling the multiple page size support.

Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. along with analyzing trends and results. and. Summary As discussed. you must establish a baseline. and how to tune them. we covered the effect of using AME to squeeze more memory out of your systems. Part 1. Part 3 focuses primarily on swap space and other methods to tune your VMM to maximize performance.ibm. After you tune. A value of 50 indicates that only 8 pages are required. you must capture data and analyze the results of your changes. Without this type of information. where appropriate. All rights reserved. including how to make the best use of the variable page size support. You also tuned an Oracle system to optimize utilization of the memory subsystem. You examined some important kernel parameters. Trademarks Page 9 of 13 . you never really understand the true impact of tuning. A value of 0 has the effect of promoting all 4KB pages to 64KB pages. In Part 1 of this series. Part 2 focuses much more on the detail of systems monitoring for the purposes of determining memory bottlenecks. what they do. before you tune or even start monitoring AIX 7.com/developerWorks developerWorks® value of 0 indicates that 16 pages are required.

and database administrators design. size. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. and tune a Relational Database Management System (RDMBS) for optimal performance on AIX. and sizing appropriate paging space. • "nmon performance: A free tool to analyze AIX and Linux® performance" (developerWorks. All rights reserved. • "Power to the people" (developerWorks. system administrators. implement. May 2004): Read this article for a history of chip making at IBM. • Operating system and device management: This document from IBM provides users and system administrators with complete information that can affect your selection of options when performing such tasks as backing up and restoring the system. • IBM Redbooks: See how Database Performance Tuning on AIX is designed to help system designers. Read this article to learn how to use processor affinity to restrict a process and run it only on a specified CPU. • The AIX 7.developerWorks® ibm. maintain.com/developerWorks Resources Learn • AIX memory affinity support: Learn about AIX memory from the IBM System p™ and AIX InfoCenter.1.1 Differences Guide can be a useful resource for understanding changes in AIX 6. monitor. • "Processor affinity on AIX" (developerWorks.1 Information Center is your source for technical information about the AIX operating system. • Popular content: See what AIX and UNIX content your peers find interesting. April 2006): Read this article to learn how to produce a wealth of report-ready graphs from nmon output. • "nmon analyser—A free tool to produce AIX performance reports" (developerWorks. 2002): Read this article to learn how standard AIX tools can help you determine CPU bottlenecks. Trademarks Page 10 of 13 . November 2006): Using process affinity settings to bind or unbind threads can help you find the root cause of troublesome hang or deadlock problems. • AIX and UNIX: The AIX and UNIX developerWorks zone provides a wealth of information relating to all aspects of AIX systems administration and expanding Part 1. managing physical and logical storage. • "CPU monitoring and tuning" (March.1. • The IBM AIX Version 7. • The IBM AIX Version 6.1 Differences Guide can be a useful resource for understanding changes in AIX 7. February 2006): This free tool gives you a huge amount of information all on one screen.

• AIX 7 Open Beta: This forum is for technical discussions supporting the AIX 7 Open Beta Program. • Search the AIX and UNIX library by topic: • System administration • Application development • Performance • Porting • Security • Tips • Tools and utilities • Java™ technology • Linux • Open source • Safari bookstore: Visit this e-reference library to find specific technical resources. • Future Tech: Visit Future Tech's site to learn more about their latest offerings. Discuss • Participate in the developerWorks blogs and get involved in the developerWorks community. Trademarks Page 11 of 13 . • developerWorks technical events and webcasts: Stay current with developerWorks technical events and webcasts. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. • Follow developerWorks on Twitter. • Podcasts: Tune in and catch up with IBM technical experts. • Get involved in the My developerWorks community. • Participate in the AIX and UNIX® forums: Part 1. All rights reserved.ibm. • New to AIX and UNIX?: Visit the New to AIX and UNIX page to learn more about AIX and UNIX.com/developerWorks developerWorks® your UNIX skills. Get products and technologies • IBM trial software: Build your next development project with software for download directly from developerWorks.

He is also a regular blogger at Computerworld. and integration.developerWorks® ibm. C++. C.com and provides Linux technical information and support at Searchopensource. You can Part 1. Windows®. He is the founder and group leader of the N.Y. He is the author of numerous books and articles across a range of topics. Linux. and a frequent contributor of content for IBM developerWorks. Rebol. Pascal. Gawk. Modula-2. Basic. as well as a master's degree in technology management from the University of Maryland University College. Python.Perl. JavaScript. systems management. BeOS. is a PMI-certified Project Management Professional (PMP).com. Trademarks Page 12 of 13 . All rights reserved. and other sites. LinuxToday.com. He is also a writer and technical editor for IBM Systems Magazine. and IBM developerWorks. Solaris. and is also IBM SCon certified. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010. Shellscript.com. He is a Subject Matter Expert (SME) for Microsoft® and regular contributor to ServerWatch. Through the years. Metro POWER-AIX/Linux Users Group.com/developerWorks • AIX Forum • AIX Forum for developers • Cluster Systems Management • Performance Tools Forum • Virtualization Forum • More AIX and UNIX Forums About the authors Ken Milberg Ken Milberg is a technology writer and site expert for Techtarget. Martin Brown Martin Brown has been a professional writer for more than seven years. He is currently president and managing consultant for UNIX-Linux Solutions. His expertise spans myriad development languages and platforms -. Mac OS X and more -. Power Systems edition.as well as web programming. The Apple Blog. Java™. He holds a bachelor's degree in computer and information science. he has worked for both large and small organizations and has held diverse positions from CIO to senior AIX engineer. an IBM Certified Advanced Technical Expert (CATE).

Trademarks Page 13 of 13 . All rights reserved. Memory overview and tuning memory parameters © Copyright IBM Corporation 2010.ibm. Part 1.com/developerWorks developerWorks® contact him through his web site.

Sign up to vote on this title
UsefulNot useful