zEnterprise Data Compression (z/OS only)

zEnterprise® Data Compression (zEDC) is a hardware/software compression acceleration solution that can increase the speed of data compression on some z/OS® systems. If your application uses Java™ compression services extensively, zEDC can provide reduced CPU consumption and shorter processing times.

Before you begin

You must have one of the following hardware systems: IBM zEnterprise zEC12 GA2, zBC12, z13® or later. Additional requirements depend on your hardware system:Start of changes for service refresh 6
z15 or later
Apply one of the following PTFs, according to your level of z/OS:
  • z/OS 2.4: UJ00636
  • z/OS 2.3: UJ00635
  • z/OS 2.2: UJ00638
There are no hardware requirements for z15 or later systems. The Integrated Accelerator for zEDC solution in these systems provides built-in data acceleration, so a separate adapter is no longer required.
End of changes for service refresh 6
z14 or earlier
Your system must also have the following requirements:
  • A zEDC Express® adapter, installed in the PCIe I/O drawers of the hardware system.
  • The zEDC software capability (an optional, paid-for feature) must be enabled in an IFAPRDxx parmlib member.
For the most up-to-date list of requirements, see the documentation for your version of z/OS, for example: Requirements for zEnterprise Data Compression.

About this task

zEDC supports the DEFLATE compression format. Because this is a standard format, you can transfer compressed or decompressed data to a system other than IBM Z®, for decompression or compression.

zEDC is provided by an IBM® zlib library within the java.util.zip package. For more information about zEDC, see the documentation for your version of z/OS, for example: zEnterprise Data Compression (zEDC).

Procedure

  1. z14 and earlier only: Grant READ access to the FPZ.ACCELERATOR.COMPRESSION resource class to the user ID that will run the Java application.
    This resource class is a System Authorization Facility (SAF) FACILITY resource class, which regulates access to the zEDC coprocessor. This requirement does not apply to z15 or later processors.
  2. Use the z/OS UNIX environment variable, _HZC_COMPRESSION_METHOD, to control whether zEDC is used.
    By default, zEDC is used. If you set this variable to software, software-based compression services are used instead. If you set any other value, zEDC is used.
  3. Ensure that the z/OS input buffers for your Java application are sufficiently large.
    Some CPU resource is required to send data to the zEDC feature for compression or decompression. For small amounts of data, this resource cost can be greater than the savings that are achieved by using zEDC. You can set threshold values for the data that is compressed and decompressed by zEDC; if the size of the data is below the relevant threshold, zlib software compression is used instead:
    Start of changes for service refresh 6
    z15 and later
    Use the environment variables _HZC_DEFLATE_THRESHOLD and _HZC_INFLATE_THRESHOLD to control the threshold for zEDC usage. The valid values are in the range 1-9999999. For example, _HZC_DEFLATE_THRESHOLD=1 forces all deflate requests with an initial input size of 1 byte or larger to use zEDC. The default value is 1024 for both deflate and inflate.
    Unlike the DEFMINREQSIZE and INFMINREQSIZE parameters used on z14 or earlier systems, the _HZC_DEFLATE_THRESHOLD and _HZC_INFLATE_THRESHOLD environment variables are application-specific. You must either add the variables to your /etc/.profile file to make them apply across your system, or set them for each application where you want to override the system default threshold for hardware compression.
    End of changes for service refresh 6
    z14 and earlier
    Use the DEFMINREQSIZE and INFMINREQSIZE parameters of the IQPPRMxx parmlib member to control the threshold for zEDC usage. For more information, see the IQPPRMxx section in the documentation for your version of z/OS, for example: IQPPRMxx (PCIE related parameters).

    Note: On z15 or later processors, the IQPPRMxx parmlib member is allowed in the configuration but the DEFMINREQSIZE and INFMINREQSIZE values are not accepted.

    Here are some methods for determining an application's current buffer size:
  4. Optional: z14 and earlier only: Set the amount of storage that is allocated for z/OS I/O buffers.
    The zEDC requests that are generated by the zlib library use predefined z/OS I/O buffer pools. The buffer pools contain a number of 16 MB storage areas called segments. You can set the size of the buffer pools by using the MAXSEGMENTS parameter of the IQPPRMxx parmlib member to specify the number of segments. The default value is 4 (64 MB). For more information, see the IQPPRMxx section in the documentation for your version of z/OS, for example: IQPPRMxx (PCIE related parameters).

    Note: On z15 or later processors, these buffers are not required. The IQPPRMxx parmlib member is still allowed in the configuration, but the values are not accepted.

  5. In your Java application, use the classes and methods in the java.util.zip package to compress and decompress data.
    The following example (which excludes imports and try/catch blocks) uses the GZIPOutputStream class to read data from one file and write compressed data to another file:
    // This 64 KB input buffer exceeds the threshold value set by DEFMINREQSIZE, so is elegible for compression by zEDC:
    byte buffer[] = new byte[64 * 1024];
    byte outputFile[];
    
    input = new FileInputStream(argv[0]);
    output = new ByteArrayOutputStream();
    gzStream = new GZIPOutputStream(output, 4096);
    
    for(;;) {
        // Read data from an uncompressed file:
        readBytes = input.read(buffer);
        if(readBytes < 0) {
            break;
        }
        else {
            // Write data to a compressed file:
            gzStream.write(buffer, 0, readBytes);
        }
    }

Results

If your system meets the requirements and conditions described, zEDC is used. Otherwise, software-based compression services are used for data compression and decompression.

What to do next

You can use the D IQP command to view the current values for the zEDC parameters. The following examples show the command output:
Start of changes for service refresh 6z15 or later:
RESPONSE=S5B                                       
 IQP066I 13.20.46 DISPLAY IQP 826                 
 zEDC Information                                 
  DEFMINREQSIZE:               1K (STATIC)          
  INFMINREQSIZE:               1K (STATIC)         
  Feature Enablement:    Enabled 
End of changes for service refresh 6
z14 or earlier:
RESPONSE=CB8B
 IQP066I 05.55.28 DISPLAY IQP 458
 zEDC Information
  MAXSEGMENTS:            4 (64M)
  Previous MAXSEGMENTS:   N/A
  Allocated segments:     4 (64M)
  Used segments:          0 (0M)
  DEFMINREQSIZE:          4K
  INFMINREQSIZE:          32K
  Feature Enablement: Enabled