For information on tuning DB2® tables and the DB2 subsystem, and for general considerations when tuning a DB2 application, see the DB2 Universal Database™ for OS/390® and z/OS® Administration Guide.
The CICS® DB2 attachment facility provides a multithread connection to DB2. The connections between CICS and DB2 are called threads. There are three types of thread:
Entry threads can be defined as protected. When an entry thread is released, if it is protected, it is not terminated immediately. It is kept for a period of time, and if another CICS transaction needs the same type of entry thread during that period, it is reused. This avoids the overhead involved in creating and terminating the thread for each transaction. Entry threads are terminated after two consecutive periods of inactivity. These periods are defined in the DB2CONN parameter, PURGECYCLE. An entry thread that is unprotected is terminated immediately, unless a CICS transaction is waiting to use it the moment it is released.
The DB2CONN, DB2ENTRY, and DB2TRAN definitions of the CICS DB2 attachment facility define the authorization and access attributes on a transaction and transaction group basis.
When tuning the CICS DB2 attachment facility, you must understand the underlying architecture. See CICS DB2 Guide for more information.
CICS DB2 Guide explains the recommendations for defining the CICS DB2 connection for optimum performance. CICS DB2 Guide has recommendations for application design, and CICS DB2 Guide has recommendations for tuning CICS DB2 applications.
In summary, the objectives in tuning the CICS attachment facility are to:
The total number of threads in the connection, and the number of threads for each dedicated entry and the pool must be optimized. A larger number of threads than is needed requires additional processor time to dispatch the TCBs and additional storage for plans, data, and control blocks. If an insufficient number of threads is defined, response time increases.
Reusing threads avoids the thread creation and termination process, including plan allocation and authorization checks. Thread creation and termination represent a significant part of the processing time for a simple transaction. Thread reuse can be measured using CICS DB2 statistics.
Limit conversational transactions either through transaction classes or by using a dedicated DB2ENTRY (THREADLIMIT greater than 0) with THREADWAIT=YES specified. Otherwise, they tie up the pool. Do not allow conversational transactions to use the pool.
You can optimize performance between CICS and DB2 by adjusting the transaction class limits, MXT system parameters of CICS, and the THREADWAIT, TCBLIMIT, THREADLIMIT, and PRIORITY attributes of DB2CONN and DB2ENTRY.
The following facilities are available to monitor the CICS DB2 attachment facility.
The CICS performance class monitoring records include the following DB2-related data fields:
CICS monitoring is used in the CICS DB2 environment with the DB2 accounting facility, to monitor performance and to collect accounting information.