Under Construction
Using the NX (gzip) Accelerator with xgzip
The most direct way to use the NX (gzip) accelerator is via the xgzip and xgunzip commands. These can be installed by the fileset xgzip.rte. The fileset can be downloaded from the IBM AIX Web Download Pack Programs website.
After downloading, the fileset can be easily installed with “installp”:
# installp -acXYd xgzip.rte all
+-----------------------------------------------------------------------------+
Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
...
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
xgzip.rte 4.0.20.0 USR APPLY SUCCESS
#
Note: The “-Y” option is necessary because IBM’s license terms must be agreed to!
During installation, links are automatically created under /bin for the two commands xgzip and xgunzip. The shell’s search path therefore does not need to be adjusted.
In order to determine the difference between compression and decompression with and without hardware acceleration using the NX (gzip) accelerator, we have used an approximately 1.5 GB test file:
$ ls -l file1.tar
-rw-r--r-- 1 user staff 1535078400 Mar 22 19:25 file1.tar
$
The file is compressed once for each test and then decompressed. The duration of time is determined in each case. Different compression levels (“-1”, “-5” and “-9”) are tested. Here is an example run with xgzip and xgunzip:
$ time xgzip -9 file1.tar
real 0m7.108s
user 0m0.191s
sys 0m1.683s
$ ls -l file1.tar.gz
-rw-r--r-- 1 user staff 1286050485 Mar 22 19:32 file1.tar.gz
$ time xgunzip file1.tar.gz
real 0m6.240s
user 0m0.630s
sys 0m1.338s
$
The table below lists the values of all tests:
| gzip -1 | xgzip -1 |
| gzip -5 | xgzip -5 |
| gzip -9 | xgzip -9 |
|
real | 0m54.576s | 0m5.277s | 10.34 | 1m9.851s | 0m5.132s | 13.61 | 1m36.966s | 0m5.147s | 18.84 |
user | 0m16.692s | 0m0.196s | 85.16 | 0m21.483s | 0m0.190s | 113.07 | 0m30.153s | 0m0.191s | 157.87 |
sys | 0m0.979s | 0m1.358s | 0.72 | 0m1.009s | 0m1.333s | 0.76 | 0m0.990s | 0m1.338s | 0.74 |
size | 1180456728 | 1286050485 | 1157685954 | 1286050485 | 1155742624 | 1286050485 | |||
| gunzip | xgunzip |
| gunzip | xgunzip |
| gunzip | xgunzip |
|
real | 0m17.745s | 0m6.229s | 2.85 | 0m18.763s | 0m6.298s | 2.98 | 0m17.403s | 0m6.235s | 2.79 |
user | 0m4.575s | 0m0.630s | 7.26 | 0m4.421s | 0m0.629s | 7.03 | 0m4.398s | 0m0.630s | 6.98 |
sys | 0m1.121s | 0m1.337s | 0.84 | 0m1.213s | 0m1.346s | 0.90 | 0m1.153s | 0m1.336s | 0.86 |
What is immediately noticeable about the values for xgzip is that the time required for compression is independent of the optimization option and that the compressed file is the same size in all cases. So hardware compression obviously doesn’t support different levels of optimization. There is only the option to use hardware compression or not. It is also noticeable that the software compression achieves higher compression in all cases.
The difference between xgzip and gzip is approximately 10 times shorter runtime (values for optimization level “-1”). CPU usage (user mode) is approximately 85 times higher with software compression than with hardware compression. This means that hardware compression is significantly faster and uses significantly less CPU time. However, this comes at the expense of the compression achieved, which is about 10% higher with software compression (i.e. significantly smaller compressed file).