If you’re experiencing poor response times, can threadsafe help resolve your problem? Here are the questions you must answer:
- What percentage of CPU is my QR TCB running?
- Does my QR TCB have to wait to be dispatched by the operating system?
- Are a high number of tasks running under the QR TCB being delayed?
- Are application programs waiting excessively for the QR TCB?
If you answered yes to most of the questions, then defining programs as threadsafe and processing as many tasks as possible on an open TCB will remove this constraint on the QR TCB and reduce the response times of both threadsafe and non-threadsafe transactions.
Steven R. Hackenberg also gave this recommendation: “As the QR TCB exceeded 50 percent of a single CP, or the CPU consumed by QR and higher priority workloads exceeded 50 percent of the LPAR [Logical Partition], experience has shown that ready transactions would begin to queue while trying to gain access to the QR TCB. This would be evidenced by the rapid increase in wait-on-first-dispatch and wait-on-redispatch times found in the CMF 110 performance records, and rapidly eroding total response times.”
Selecting the Pilot Threadsafe Application
Because the CPU reduction in threadsafe programs is the result of eliminating the TCB switch overhead from every DB2 call, you’ll receive the greatest benefit by converting heavily used programs that issue large numbers of DB2 requests. Review your CMF statistics to identify how many DB2 calls each application issues and then multiply that number by the number of application transactions per second in your environment. You can use the result to sort your applications by DB2 calls (i.e., TCB switches) per second; the higher the number, the greater the potential CPU savings.
For a pilot project, you must also consider the scope and complexity of the conversion. The ideal candidate will have a combination of:
- A relatively small number of programs to limit the scope of the review
- Few (or no) Assembler programs. Unless your shop has strong Assembler skills, reviewing Assembler programs for non-threadsafe activity can be difficult.
- All COBOL or PL/1 programs LE-compliant and compiled and linked as RENT.
Additionally, applications running in a QR-constrained CICS environment—where transactions have a large wait for QR dispatch—will show additional reduction in response time, as application code processing is diverted to the L8 TCBs.
Running DB2 programs as threadsafe on the CICS Open Transaction Environment is a true win-win scenario. It provides us the opportunity to significantly reduce CPU requirements in our production regions while simultaneously increasing throughput by exploiting the z/OS multi-processor environment.