Is it possible to change SQL in a z/OS mainframe COBOL application so that it becomes eligible to be directed to the IBM System z Integrated Information Processor (zIIP)?
I posted this answer in response to the same question on StackOverflow, so here is a re-post:
An important distinction to make is that according to IBM, zIIP is only available for "eligible database workloads", and those "eligible" loads are mostly targeted for large BI/ERP/CRM solutions that run on distributed servers, which are connecting through DDF (Distributed Data Facility) over TCP/IP.
IBM has a list of DB2 workloads that can utilize zIIP. These include:
- DDF server threads that process SQL requests from applications that access DB2 by TCP/IP (up to 60%)
- Parallel child processes. A portion of each child process executes under a dependent enclave SRB if it processes on behalf of an application that originated from an allied address space, or under an independent enclave SRB if the processing is performed on behalf of a remote application that accesses DB2 by TCP/IP. The enclave priority is inherited from the invoking allied address space for a dependent enclave or from the main DDF server thread enclave classification for an independent enclave. (Versions up to 11 allowed 80% to run on zIIP, v12 upped this to 100% eligible).
- Utility index build and maintenance processes for the LOAD, REORG, and REBUILD INDEX utilities.
And if you're on DB2 v10, you can also use zIIP with:
- Remote native SQL procedures.
- XML Schema validation and non-validation parsing.
- DB2 utility functions for maintaining index structures.
- Certain portions of processing for the RUNSTATS utility.
- Prefetch and deferred write processing for the DB2 buffer pool
Version 11 added the following:
- Asynchronous enclave SRBs (service request blocks) that execute in the Db2 ssnmMSTR, ssnmDBM1 and ssnmDIST address spaces, with the exception of p-lock negotiation processing. These processes include Db2 buffer pool processing for prefetch, deferred write, page set castout, log read, and log write processing. Additional eligible processes include index pseudo-delete and XML multi version document cleanup processing.
Version 12 allowed parallel child tasks to go 100% to zIIP after a certain threshold of CPU usage.
So, if you're using COBOL programs, it would appear that IBM does not intend for you to use zIIP with these workloads. You can still take advantage of zIIP with utilites (LOAD, REORG), and some steps of the RUNSTATS utility, so it may still be worthwhile to have some zIIP.
The point of zIIP processors is that you can't run z/OS code on them. Your COBOL code won't run on them. However, according to this article DB/2 for z/OS is an eligible workload to run on a zIIP processor. I presume your COBOL code has embedded SQL. Embedded SQL architectures are actually preprocessors that generate code that sends the query off to the database behind the scenes, so your SQL code is going to run on the DB server.
If the COBOL programme is sending SQL to the DB/2 server via TCP/IP (DRDA) then it should run on the zIIP if the DB/2 server is configured to run on it. If the COBOL code is doing a lot of client-side processing or it's not using this then this will not be eligible. Chances are the COBOL app is not using DRDA, though.
When Db2 executes a query using CPU parallelism, the parallel child tasks qualify for zIIP offload. This is typically only viable for queries that are not transactional in nature (eg. consume more than a cpu second per execution).