Introduction
The DB2 agent is a process or thread located on the DB2 server that serves application requests. When an external application connects to a DB2 instance to request access, the DB2 proxy is activated to respond to these requests. Generally, DB2 proxies are called work proxies. There are three types of work proxies: idle proxies, active coordination proxies, and sub-proxies.
◆ Idle Proxy: A proxy without any tasks. This proxy does not serve any remote connection or local connection, and is in a standby or standby status.
◆ Activity Coordination Proxy: it refers to a working agent. Each database activity connection generated by an external application has an Activity Coordination proxy to serve it.
◆ Sub-agent: refers to the next-level agent that accepts the work distributed by the coordination agent. Before DB2 V95, A subproxy exists only in a multi-partition environment (MPP) or in-node parallel environment (SMP), and may exist in all environments of DB2 V95.
There is a proxy pool in the DB2 server. When the instance is started, there will be some proxies (the number of proxies depends on the instance parameter NUM_INITAGENTS ). When there is no database connection, they are in standby status, that is, idle proxy. When an external program connects to the database, these agents start to get commands to serve these new connections, and then they become active Coordination Agents. These coordination proxies further split requests and allocate them to the next level of proxies, that is, the subproxies. If the current proxy is already working and a new request is sent, the Database Manager generates a new proxy to respond. After the transaction is processed and the database connection is disconnected, the Coordination proxy either returns the proxy pool to the idle proxy or disappears automatically (depending on the instance parameter NUM_POOLAGENTS ). This is the life cycle of a proxy.
Related configuration parameters
Run DB2 get dbm cfg to view the following proxy-related instance parameters: MAXAGENTS, NUM_POOLAGENTS, NUM_INITAGENTS, MAX_COORDAGENTS, MAX_CONNECTIONS, and MAXCAGENTS. Next we will give a brief introduction to them:
◆ MAXAGENTS: this parameter indicates the total number of proxies in the current instance, including the sum of the Coordinated proxies, idle proxies, and sub-proxies. However, this parameter is no longer used in DB2 V95.
◆ NUM_POOLAGENTS: this parameter is used to control the number of idle proxies in the proxy pool. When the active proxy completes the work and returns the proxy pool to the idle proxy, if the quantity exceeds this parameter, the proxy will automatically disappear. Note: When the connection concentrator is activated, the number of idle proxies in the proxy pool may exceed the NUM_POOLAGENTS size at a certain time point to cope with sudden high-density connections.
◆ NUM_INITAGENTS: the number of idle proxies generated when the instance is started. This is to improve performance, because these proxies can be changed to coordination proxies to respond to external application requests at any time, instead of temporarily generating new proxies.
◆ MAX_COORDAGENTS: this parameter determines the maximum number of coordinated proxies in an instance at the same time (the maximum number of coordinated proxies on a node in a multi-partition environment ).
◆ MAX_CONNECTIONS: this parameter determines the maximum number of connections allowed to an instance (the maximum number of connections on a node in a multi-partition environment ).
◆ MAXCAGENT: this parameter determines the number of tokens in the instance. A coordination agent can only get the token to serve the application. When no token is obtained, the Coordination proxy can only wait. However, this parameter has been canceled in DB2 V95.
- DB2 database migration FAQs
- Common Stored Procedure paging programs in DB2
- Steps for restoring a database from a DB2 backup