AIX

 View Only

GZIP Acceleration with AIX on Power Systems

By Brian F. Veale posted Mon March 14, 2022 03:40 PM

  
IBM Power9 and Power10 servers include a GZIP based hardware accelerator that is supported by AIX 7.2 and 7.3. This article presents how to configure and use the accelerator.

AIX uses a clone of the zlib library named zlibNX that transparently uses the accelerator when available. The pigz command available for AIX 7.2 and 7.3 uses zlibNX to accelerate file compression and decompression; openSSH leverages zlibNX when configured for compression, and the create_ova command, available in AIX 7.3, uses the pigz command for creating OVA files for cloud deployments to compress their contents. DB2 and IBM Semeru for Java runtimes also take advantage of the accelerator through the use of zlibNX when available and configured.

Contributors: @Brian F. Veale, @NICK STILWELL, and @Carl Burnett

Hardware Acceleration on Power Systems

Each processor chip in a Power9 and Power10 server has an on-chip “nest” accelerator called the NX unit that provides specialized functions for general data compression, gzip compression, encryption, and random number generation. These accelerators are used transparently across the systems software stack to speed up operations related to Live Partition Migration, IPSec, JFS2 Encrypted File Systems, PKCS11 encryption, and random number generation through /dev/random and /dev/urandom.

The on-chip NX GZIP accelerator on POWER9 systems implements a high throughput deflate format (RFC 1951) compression engine capable of performing the equivalent work of tens to hundreds of cores.

Performance Study

We investigated the performance of compression using accelerated zlibNX versus software based compression through zlib using the Silesia compression corpus as input data to the hardware accelerator and zlib software compression engine. Using a single threaded application running on a Power10 system at 3.55 GHz with AIX 7.3 TL 0 we see up to a 200 times more compression throughput using the accelerated zlibNX with the hardware GZIP compression accelerator over software-based zlib compression.  See the figure below for more details.

Comparing compression time using the pigz command for file compression on the same system, compression using the accelerated zlibNX library and hardware accelerator completes the compression of files up to 14 times faster than when using the software-based zlib library. For both scenarios we utilized the pigz command and switched which version of the zlib library (software based zlib vs. hardware accelerated zlibNX) is being used by the pigz command. The figure below shows more details. Note that for file sizes less than 32 KB in size, we have seen that software-based compression outperforms hardware accelerated compression. This is likely due to the overhead of setting up and accessing the accelerator.

Installation and Configuration on AIX

Requirements

Supported Systems:

  • Power9 running FW940 or later
  • Power10 or later


Required LPAR Configuration:

The LPAR must be configured to run in ‘Power9’ or ‘Power10’ or later processor compatibility mode.  The GZIP accelerator is not available to partitions when running ‘Power9_base’ processor compatibility mode.

See below for more information on how to check the processor compatibility mode.

Other system requirements will vary depending on the application workload running on the partition.


CPU and Memory Recommendations:

Minimum 1 processor and 6 GB of memory.

Supported AIX levels:

AIX 7.2 TL 4, AIX 7.2 TL 5, and AIX 7.3 and later.

Validating required FW level (only needed for Power9 systems)
On Power9 the system must be running FW940 or later.
The FW level and configuration can be verified via the AIX command line via the prtconf command:

# prtconf
System Model: *
Machine Serial Number: *
Processor Type: PowerPC_POWER9
Processor Implementation Mode: POWER 9
Processor Version: PV_9_Compat
Number Of Processors: 4
Processor Clock Speed: 3000 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: *
Memory Size: 32768 MB
Good Memory Size: 32768 MB
Platform Firmware level: VH940_027
Firmware Version: IBM,FW940.00 (VH940_027)


Processor Compatibility Mode Configuration

On Power9 the LPAR must be running in ‘Power9’ processor compatibility mode and on Power10 the LPAR must be running ‘Power9’ or ‘Power10’ processor compatibility mode.  The accelerator is not supported when running in ‘Power9_base’ processor compatibility mode.

The current processor compatibility mode can be verified from an HMC that manages the partition. Navigate to the partition’s properties page, click the Processor tab and click Advanced. The Effective Processor Compatibility

Note that changes to the mode require a reboot of the partition in order to take effect.

 

Using the nxstat command to validate configuration of the hardware GZIP accelerator

Starting with AIX 7.2 TL 5 SP 3 (7200-05-03-2136) and AIX 7.3 you can validate that the LPAR is properly configured to use the hardware GZIP accelerator using the nxstat -S command. Below are examples showing an LPAR where the accelerator is not available and where it is available.

This example is on an LPAR set to use the POWER9_base processor compatibility mode resulting in the compression accelerator not being available:

# nxstat -S
nx_accel_mask = 0

 ** No accelerators available **
 ** Accelerators are not available for partitions in POWER9_base mode

 

And in the example below, the accelerator is available (after switching to POWER9 or POWER10 mode):

# nxstat -S
nx_accel_mask = 1

GZIP accelerator available

Installation of the zlibNX library and pigz Commands

This table shows where you can obtain the zlibNX library and the pigz command
AIX Level Where to get zlibNX.rte

Where to get the pigz command

AIX 7.2 TL 4 Expansion Pack AIX Toolbox for Open Source Software
AIX 7.2 TL 5 SP 1 Expansion Pack AIX Toolbox for Open Source Software
AIX 7.2 TL 5 SP 2 and later
AIX Installation Media AIX Toolbox for Open Source Software
AIX 7.3 and later
Installed by default (AIX installation media)

Installed by default (AIX installation media)

How to install from the Expansion Pack: https://www.ibm.com/docs/en/aix/7.2?topic=notes-aix-720-expansion-pack-release
AIX Toolbox for Open Source Software: https://www.ibm.com/support/pages/aix-toolbox-open-source-software-downloads-alpha#P
How to setup DNF to install from the AIX Toolbox for Open Source Software: https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2021/05/28/dnf-is-now-available-on-aix-toolbox

See below for examples of how to install zlibNX.rte and pigz.

Note that IBM is no longer focusing on updates to the xgzip command for AIX since the open-source based pigz utility leverages the zlibNX library to accelerate compression and is easier to obtain and install.

zlibNX library

Depdending on which AIX level you are on, you can either get the zlibNX library from the installation media or the Expansion Pack.  If you are on AIX 7.3 it is installed by default.

To install from the expansion pack or installation media you either mount the media and copy the zlibnx.rte fileset to the local partition or install directly from the media.  In the example below the media or expansion pack is mounted on /dev/cd0:

Run installp to install zlibNX:

# installp -aXgqY -d/dev/cd0 zlibNX.rte

Verify installation with the lslpp command:

# lslpp -l zlibNX.rte
  Fileset                      Level  State      Description
  ---------------------------------------------------------------------
Path: /usr/lib/objrepos
  zlibNX.rte                 7.2.4.0  COMMITTED  NX accelerated zlib
                                                 compression library

Pigz command:

You can install pigz directly from the AIX Toolbox for Open Source Software using dnf. Note, if you are running AIX 7.3, pigz is already installed by default.

See here for information on how to configure DNF: https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2021/05/28/dnf-is-now-available-on-aix-toolbox

# dnf install pigz

 
Verify installation with the dnf command:

# dnf list installed pigz
Installed Packages
pigz.ppc                           2.4-1                            @AIX_Toolbox

Using the pigz Commands

pigz similar flags and parameters as the gzip command. Below is an example of compressing a file (and keeping the original file) using gzip, and pigz:

# pigz –c mybackup > mybackup.gz
# gzip -c mybackup > mybackup.gz

For more usage information, the pigz man page can be found here: https://zlib.net/pigz/pigz.pdf

Using OpenSSH with hardware GZIP accelertation

OpenSSH now includes the capability to exploit the hardware GZIP accelerator using the -C option for commands such as scp and sftp when properly configured. This section discusses where to get OpenSSH for AIX from and the basic configuration steps required to enable compression acceleration.

You must have installed zlibNX.rte (if on AIX 7.3 it is installed by default) and configured the LPAR to run in a processor compatibility mode supporting hardware GZIP acceleration (see above in this document on how to configure the LPAR and install zlibNX).

The requisite OpenSSH fileset is available on the AIX installation media as well as the AIX web download pack here: https://www-01.ibm.com/marketing/iwm/iwm/web/pickUrxNew.do?source=aixbp&S_PKG=openssh

To exploit hardware GZIP acceleration with OpenSSH it is recommended that you use at least version 8 .1.102.2104 or later.

It is recommended that the latest version of OpenSSL be used to address known security vulnerabilities. The latest version is available here: : https://www-01.ibm.com/marketing/iwm/iwm/web/pickUrxNew.do?source=aixbp&S_PKG=openssl

To install either mount the AIX installation media and copy the fileset to a local partition or install from the media.  If installing a version from the AIX Web Download pack them copy the downloaded tarball file to the local partition, uncompress it, and install as shown below.

Installing from the AIX Web Download Pack

In the example below the OpenSSH tarball is located on a local disk. When uncompressed with tar a sub-directory will be created containing the packages to be installed.

# gunzip OpenSSH_8.1.102.2104.tar.Z
# tar -xvf OpenSSH_8.1.102.2104.tar 
# installp -aXgqY -d ./OpenSSH_8.1.102.2104 openssh.base


Verify installation with the lslpp command:

# lslpp -l openssh.base.client openssh.base.server
  Fileset                      Level  State      Description        
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  openssh.base.client   8.1.102.2104  COMMITTED  Open Secure Shell Commands
  openssh.base.server   8.1.102.2104  COMMITTED  Open Secure Shell Server

Path: /etc/objrepos
  openssh.base.client   8.1.102.2104  COMMITTED  Open Secure Shell Commands
openssh.base.server   8.1.102.2104  COMMITTED  Open Secure Shell Server


Configure OpenSSH to use the hardware GZIP accelerator

Once OpenSSH is installed, you can configure OpenSSH to user hardware GZIP acceleration when the -C command is specified by following these steps:

On the server:

Set the value for ‘Compression’ in sshd_config to ‘delayed’ or ‘yes’. A value of ‘delayed’ is recommended so that compression is not enabled until the user has authenticated. The setting of ‘delayed’ ensures that there is no risk of a zlib vulnerability leading to a compromise of the server from non-authenticated users.

You also need to add the keyword EnableHwCompression to sshd_config and set it to yes to enable hardware compression acceleration.

# grep Compression /etc/ssh/sshd_configCompression delayedEnableHwCompression yes

Then, you must stop and restart the SSH daemon using stopsrc and startsrc:

# stopsrc -s sshd
# startsrc -s sshd

 

On the client:

Add the keyword EnableHwCompression to ssh_config and set it to yes to enable hardware compression acceleration.

# grep Compression /etc/ssh/ssh_config EnableHwCompression yes


Using OpenSSH with the hardware GZIP accelerator

Once SSH is installed and configured, zlibNX.rte is installed, and the LPAR is configured appropriately you can use the sftp, scp, and ssh commands with the -C option:

# ssh -C user@hostname

# sftp -C user@hostname

# scp -C file_to_transfer user@hostname:/destination_directory_path

Enabling Existing Applications to Leverage hardware GZIP acceleration

Applications that dynamically link with zlib can be accelerated by zlibNX using one of the following methods:

Set the LDR_PRELOAD or LDR_PRELOAD64 variable to load the hardware-accelerated zlib library before the standard zlib library as shown below: 

# LDR_PRELOAD="/usr/opt/zlibNX/lib/libz.a(libz.so.1)" <32-bit application>
# LDR_PRELOAD64="/usr/opt/zlibNX/lib/libz.a(libz.so.1)" <64-bit application>

 Set the LD_LIBRARY_PATH variable as shown below:

# LD_LIBRARY_PATH=/usr/opt/zlibNX/lib:$LD_LIBRARY_PATH <application>

 Set the LIBPATH variable as shown below:

# LIBPATH=/usr/opt/zlibNX/lib:$LIBPATH <application>

IBM Semeru Runtimes for Java and DB2 Exploitation of hardware GZIP acceleration

DB2 Backup and Restore


DB2 11.5.7 and later automatically takes advantage of the GZIP accelerator when the zlibNX library is installed and the GZIP accelerator is enabled (see above under Installation and Configuration on AIX).  Acceleration is leveraged for compression and decompression operations during backup and restore operations.
 
See here for more information: https://www.ibm.com/docs/en/db2/11.5?topic=1157-high-availability-backup-resiliency-recovery-enhancements 

IBM Semeru Runtimes for Java


Starting with IBM Semeru Runtime Open / Certified Edition for Java versions 8, 11, 16, and 17 on AIX, the runtime environment now uses the system provided zlib library such that zlibNX is automatically used when available and the GZIP accelerator is available (see above under Installation and Configuration on AIX). Acceleration is automatically leveraged for both internal compression operations (in handling of zip and jar files) as well as by the java.util.zip class library that provides compression services for programs.

IBM Semeru Runtimes can be downloaded here: https://developer.ibm.com/languages/java/semeru-runtimes/downloads

Resources

0 comments
54 views

Permalink