IBM Support

Active Memory Expansion (AME)

Question & Answer


Question

How to monitor the Active Memory Expansion behavior and set the appropriate Expansion Factor?

Cause

The Active Memory Expansion Planning Tool is the appropriate way to handle AME.

It's not always a good choice to work with AME.

Answer


This document discusses how to enable, configure and monitor the active memory expansion feature appropriately and the benefits active memory expansion offer, the expected problems and how to avoid.

Active Memory Expansion (AME) definition:
Active Memory Expansion is a feature to expand the operating system working memory starting from AIX 6.1 TL04 SP02

How does the Active Memory Expansion work?
  • It works through memory compression technology.
  • Compress in-memory data allowing more data to be placed into memory.
  • The feature will compress a portion of the LPAR's memory (Compressed Pool).
  • It will leave the remaining portion of memory uncompressed (Uncompressed Pool).

How to check if your system is Active Memory Expansion capable?
image 4615
  • To enable AME you need to check first if the managed system is active memory expansion AME capable.
  • From the hardware management console, select the managed system you need to check.
  • Open 'Properties' for the managed system
  • Then go to the 'Capabilities' tab.
  • Check the entry 'Active Memory Expansion Capable'.
  • If 'True', the system will be capable to support active memory expansion.
  • No limits for logical partitions number to use the AME in a system.
  • Within the same system, you can enable AME for a specific partition while the other partitions are not enabled.
  • Active memory expansion is chargeable for permanent enablement per managed system.
  • Or you can get 60 days trial via Capacity on Demand to test on your environment.
  • The following screenshot shows a system not capable for Active Memory Expansion.

How to activate the Active Memory Expansion (AME)?
  • Activation of the active memory expansion should be through the Hardware Management Console.
  • Enable a logical partition to use active memory expansion from its profile.
  • Go to edit the logical partition profile you need to enable active memory expansion.
  • Go to the Memory tab.
  • You will find an entry as 'Activate Memory Expansion'.
  • The check box is to enable the active memory expansion.
  • There is a text box so you can add the active memory expansion factor.
  • To complete the active memory expansion enablement you need a hard reboot.
  • The hard reboot means we need to shutdown the logical partition from its AIX prompt.
  • Then to activate the partition up again via hardware management console from profile.
  • After the logical partition back up again you will have the active memory expansion enabled.
  • To confirm AME is enabled, lparstat -i shows Memory Mode : Dedicated-Expanded

What is the expansion factor?
  • The expansion factor is the factor the true memory will be multiplied with.
  • The Expanded Memory = True Memory X Expansion Factor
  • Expansion factor ranges are within 1.00 - 10.00
  • It's not logic to set the expansion factor as 1.00
  • Using expansion factor as 1.00 will not let you get any memory expansion amount.
  • We didn't see an expansion factor with 10.00 before.
  • You can use the dynamic logical partitioning feature to change the expansion factor.
  • Through the dlpar for (memory add or remove) you can edit the expansion factor.

Changing the AME expansion factor
To dynamically change the Active Memory Expansion factor for a logical partition, complete the following steps by using the HMC:
  • In the navigation pane, open Systems Management > Servers, and click the managed system on which the logical partition is located.
  • In the contents pane, select the logical partition for which you want to change the Active Memory Expansion factor.
  • From the Tasks menu, select Dynamic Partitioning > Memory > Add or Remove. The Add/Remove Memory Resources window is displayed.
  • In the Active Memory Expansion field, enter a value between 1.00 and 10.00.
  • Click OK.

How to configure the partition to work with active memory expansion?
  • The Active Memory Expansion Planning Tool is needed to finish the configuration.
  • The same tool can be used later to check the performance of Active Memory Expansion.
  • The tool suggests the appropriate expansion factor to work on partition to cover workload in peak time.

The Active Memory Expansion Planning Tool functions:
  • The Active memory Expansion Planning Tool called amepat.
  • Scans the actual memory use and determine if a workload would benefit from AME feature.
  • Provides a list of possible expansion configurations for a workload.
  • Records expected CPU utilization reference to AME for each factor.
  • Considers to maximize memory savings and minimizing additional CPU utilization.
  • Monitor and analyzes the system configuration, workload and performance statistics with AME.
  • Record systems configuration and various performance statistics into file.
  • Generate workload utilization and planning reports.
  • Can be executed on both AME enabled partition or when AME disabled.
  • Use amepat to generate a suggested expansion factor if AME is disabled.
  • Can be executed on all versions of IBM Power Systems servers supported by AIX 6.1, and later.
  • It will provide and suggest an appropriate expansion factor reference to workload in peak time.
  • It will let you know the needed CPU cycles to work with the AME.
  • It displays memory information, pinned memory, file cache, virtual memory and true memory.

Key considerations when running amepat to do workload planning:
  • The time at which to run the tool and the duration to run the tool.
  • To get the best possible results from the tool, the tool must be run during the period of peak utilization of the workload.
  • It ensures that the tool captures peak of utilization and memory usage information of the workload.
  • The duration to run the tool should be considered, we recommend using different windows.
  • If there is a change in the workload's utilization level during amepat runtime, amepat should be run again.

The following output from # amepat 1 1 command, it shows some statistics.
image 4616

The following output is a report generated from amepat from another partition:
image 4617

What are the main changes active memory expansion do?
In Old AIX levels the Active Memory Expansion will switch off AIX 64KB pages support, however the AIX Active Memory Expansion supports 64 KB Pages since AIX 7.2 TL 1 on POWER8 and POWER9 servers.

Which memory pages active memory expansion can work on?
  • Active memory expansion can compress pages within the applications on the system.
  • The active memory expansion will not work for some memory pages.
  • Active memory expansion won't compress or work on the following memory pages:
  1.         AIX kernel
  2.         Filesystem cache
  3.         Pinned memory

Key considerations when using Active Memory Expansion:
  • The POWER5+ processor supports four virtual memory page sizes: 4 KB, 64 KB, 16 MB, and 16 GB
  • The 64 KB page size is easy to use for many applications.
  • Many applications will see performance benefits when using the 64 KB page size rather than the 4 KB page size.
  • AIX has rich support for the 64 KB page size.
  • It will be important to confirm if you are really intending to enable the AME.
  • In Old AIX levels the Active Memory Expansion will switch off AIX 64KB pages support, however the AIX Active Memory Expansion supports 64 KB Pages since AIX 7.2 TL 1 on POWER8 and POWER9 servers.
  • Pinned memory and the file cache cannot be compressed.
  • The active memory expansion is not a ram disk.
  • The lower the active memory expansion factor the lower CPU cycles will be needed for AME.
  • The higher the active memory expansion factor the higher CPU cycles will be needed for AME.
  • The actual CPU usage used for Active Memory Expansion may be lower or higher depending on the workload.
  • Planning for Active Memory Expansion with amepat is very important.
  • When AME is enabled, multiple page size support is disabled and only 4K pages are used.
  • Check with the command (# vmstat -P all) for the presence of different pages.
  • Running Java and active AME at the same time on a system is not recommended due to performance implications.
  • The report won't be generated if compressible memory for the workload is small, it might happen in small memory systems.
  • If you assigned the appropriate expansion factor and the system was running with normal operation within AME then there was a change in the workload's utilization level, the amepat tool should run again to suggest another expansion factor so you can dynamically change the expansion factor to the new suggestion provided from amepat.
  • The active memory expansion feature involves a daemon named 'cmemd', this daemon is used to compress and uncompress memory when needed and some additional processor consumption might be observed for that daemon, at any case if there was any high CPU usage with cmemd process we recommend to contact IBM Support to check that issue and to provide a possible fix, as some AIX operating system levels might have AME looping endlessly during a shrink operation and cause a system hang.

How to confirm if the 64K pages is disabled?
  • Run the command # echo "vmstat -p 1" | kdb - - It will display this message 'psx = 0001 is invalid'
  • Using vmstat command, run the command # vmstat -P all

No reason to set the Expansion Factor as 1.0
  • Setting the active memory expansion factor to 1.0 is not the same as disabling AME.
  • If you need to disable AME, disable it from HMC (don't set expansion factor to 1.0).
  • Even when expansion factor is 1.0, system still needs to maintain two pools (compressed and uncompressed)
  • Then the system will consume resources specifically to the active memory expansion mechanism.
  • The path to memory will be longer if expansion factor was 1.0
  • Disable AME immediately if the expansion factor was 1.0 and no AME is required.

How to correctly assign the appropriate active memory expansion factor?
  • Using the amepat tool to get the appropriate and suggested expansion factor.
  • Use amepat for one hour to record the active memory expansion data in the specified recording file.
  • Select executing amepat during the higher workload on your environment.
  • Use the flag -R, Record the active memory expansion data in the specified recording file.
  • The recorded data can be post processed later using the -P option.
  • Use the command # amepat –R ame.int 60, it will run in background for an hour.
  • The system will show this message "Continuing Recording through background process..."
  • Check the presence of the amepat process by running # ps -ef | grep amepat
  • The outputs will be directed to ame.int file, that file can be used later and processed.
  • We recommend to try various reports during another times with high workload.
  • The report might recommend to shrink the memory if the workload was low.
  • The above example report shows a recommendation to set the memory size to 864.00 MB
  • While the assigned memory for this partition 1024 MB, so it is recommending to shrink memory.
  • After the amepat command ends, it should be ended with an hour or slightly higher a bit.
  • Use the command # amepat –P ame.int to process the ame.int file and generate a report.
  • The report above recommended to shrink the memory with expansion factor 1.19 as the workload is low.
  • You can use -t flag to let the tool use your specified size for modeling instead of the calculated one.
  • When we specified the needed target as 4096 from the same file above ame.int, the tool recommended to increase the assigned memory to 2.50GB with expansion factor of 1.6, so the target will be 4.00GB that was entered with -t flag.

How to monitor your active memory expansion behavior?
  • Check the active memory expansion different statistics with the command # lparstat -i
  • When AME is enabled, lparstat -i shows Memory Mode : Dedicated-Expanded
  • When AME is disabled, it shows mode as Dedicated.
  • Desired Memory will be the true physical memory assigned to this partition.
  • The lparstat -i command will list also Target Memory Expansion Factor.
  • Also the Target Memory Expansion Size ( Target = True memory x Expansion factor )
        Desired Memory : 32768 MB
        Target Memory Expansion Factor : 2.00
        Target Memory Expansion Size : 65536 MB
  • kdb command can be used as well # echo vmstat | kdb | grep -p true_memsizepgs
true_memsizepgs...... 0000000000800000 32.0GB
ame_memsizepgs....... 0000000001000000 64.0GB
cmem_cpool_size...... 00000000177D8A00 375.8MB
cmem_cpool_free...... 000000000403F600 64.2MB
cmem_tot_ncpgs....... 000000000005016A 1.3GB
cmem_tot_csize....... 0000000013799400 311.6MB
cur compression ratio........ 0000019B 4.11
  • Using vmstat -c 1
co: Number of page-outs per second to compressed pool.
ci: Number of page-ins per second from compressed pool.
image 4618
  • Use lparstat -c 1 to monitor the CPU consumption by the active memory expansion.
The following statistics are displayed only when the -c flag is specified:
%xcpu indicates the percentage of utilization (relative to the overall CPU consumption by the logical partition) for the Active Memory Expansion (AME) activity.
xphysc indicates the number of physical processors used for the Active Memory Expansion activity.
dxm indicates the size of the expanded memory deficit for the LPAR in MB.
image 4619
  • Using svmon command # svmon -G -O summary=ame -O pgsz=on
See the output below, it shows no 64K pages
image 4620
Note that AIX Active Memory Expansion supports 64 KB Pages since AIX 7.2 TL 1 on POWER8 and POWER9 servers.
  • Using topas as well
        TMEM = True Memory
        CMEM = Compressed Memory
        CI = Compressed Page In
        CO = Compressed Page Out
        EF = Expansion Factor
        T = target
        A = Actual

How to disable the Active Memory Expansion?
  • Edit the logical partition profile, open Memory tab.
  • Remove the check box front of 'Activate Memory Expansion'
  • Shutdown the logical partition from AIX prompt.
  • Activate the logical partition from HMC from its profile.
  • Confirm AME is disabled using the command lparstat -i, Memory Mode will show Dedicated

Cheers, Mahmoud M. Elshafey

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"}],"Version":"6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
24 June 2020

UID

isg3T1025141