From ee686a4d426ac563b2d51a7a33fe59b92bae4ae6 Mon Sep 17 00:00:00 2001
From: immarvin <yangsbj@cn.ibm.com>
Date: Mon, 14 Sep 2015 09:01:09 -0400
Subject: [PATCH] add an example on the packimage performance optimized with
 pigz enabled

---
 .../deployment/acc_initrd_rootimg_gen.rst     | 82 ++++++++++++++++++-
 1 file changed, 81 insertions(+), 1 deletion(-)

diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst
index 3bfae7859..744d76705 100644
--- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst
@@ -1,7 +1,7 @@
 Accelerating the diskless initrd and rootimg generating
 ========================================================
 
-Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-comsuming process, it can be accelerated by enabling paralell compression tool ``pigz`` on the management node with multiple processors and cores.
+Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-comsuming process, it can be accelerated by enabling paralell compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix <pigz_example>` for an example on ``packimage`` performance optimized with ``pigz`` enabled.
 
 The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. 
 
@@ -56,5 +56,85 @@ Please refer to the http://fedoraproject.org/wiki/EPEL for more details on EPEL
 ``pigz`` should be installed on the management server. Please download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then install the ``pigz`` with  ``yum`` or ``rpm``.
 
 
+.. _pigz_example:
+
+Appendix: An example on ``packimage`` performance optimization with "pigz" enabled
+----------------------------------------------------------------------------------
+
+This is an example on performance optimization with ``pigz`` enabled.
+
+In this example, a xCAT command ``packimage rhels7-ppc64-netboot-compute`` is run on a Power 7 machine with 4 cores.   
+
+The system info: ::
+
+    # uname -a
+    Linux c910f03c01p03 3.10.0-123.el7.ppc64 #1 SMP Mon May 5 11:18:37 EDT 2014 ppc64 ppc64 ppc64 GNU/Linux
+
+    # cat /etc/os-release 
+    NAME="Red Hat Enterprise Linux Server"
+    VERSION="7.0 (Maipo)"
+    ID="rhel"
+    ID_LIKE="fedora"
+    VERSION_ID="7.0"
+    PRETTY_NAME="Red Hat Enterprise Linux Server 7.0 (Maipo)"
+    ANSI_COLOR="0;31"
+    CPE_NAME="cpe:/o:redhat:enterprise_linux:7.0:GA:server"
+    HOME_URL="https://www.redhat.com/"
+    BUG_REPORT_URL="https://bugzilla.redhat.com/"
+    
+    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
+    REDHAT_BUGZILLA_PRODUCT_VERSION=7.0
+    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
+    REDHAT_SUPPORT_PRODUCT_VERSION=7.0
+
+The CPU info: ::
+
+    # cat /proc/cpuinfo 
+    processor       : 0
+    cpu             : POWER7 (architected), altivec supported
+    clock           : 3550.000000MHz
+    revision        : 2.0 (pvr 003f 0200)
+    
+    processor       : 1
+    cpu             : POWER7 (architected), altivec supported
+    clock           : 3550.000000MHz
+    revision        : 2.0 (pvr 003f 0200)
+    
+    processor       : 2
+    cpu             : POWER7 (architected), altivec supported
+    clock           : 3550.000000MHz
+    revision        : 2.0 (pvr 003f 0200)
+    
+    processor       : 3
+    cpu             : POWER7 (architected), altivec supported
+    clock           : 3550.000000MHz
+    revision        : 2.0 (pvr 003f 0200)
+    
+    timebase        : 512000000
+    platform        : pSeries
+    model           : IBM,8233-E8B
+    machine         : CHRP IBM,8233-E8B
+
+The time spent on ``packimage`` with ``gzip``: ::
+
+    # time packimage rhels7-ppc64-netboot-compute
+    Packing contents of /install/netboot/rhels7/ppc64/compute/rootimg
+    compress method:gzip
+    
+    
+    real    1m14.896s
+    user    0m0.159s
+    sys     0m0.019s
+
+The time spent on ``packimage`` with ``pigz``: ::
+
+    # time packimage rhels7-ppc64-netboot-compute
+    Packing contents of /install/netboot/rhels7/ppc64/compute/rootimg
+    compress method:pigz
+    
+    real    0m23.177s
+    user    0m0.176s
+    sys     0m0.016s
+