14.4. Monitoring and Tuning the DB2 Agents
It is crucial to make sure that the number of agents you configure in the database manager is enough to service your applications. If an agent is needed but is not available, the application will get an error. If it is a new database and you are not sure what its workload is going to be, use the database Monitoring tools to get a sense of what the workload is like.The database manager Snapshot Monitor will give you the most information on DB2 agent usage (use the GET SNAPSHOT FOR DBM command). Figure 14.6 shows a snippet of the database manager snapshot output.
Figure 14.6. Example of database manager snapshot output
When tuning MAXAGENTS, consider the Max agents overflow value. This is the number of times a request to create a new agent was received when the MAXAGENTS configuration parameter had already been reached. Increase MAXAGENTS if this value is not zero.Remote connections to db manager and Remote connections executing in db manager indicate the number of remote connections and the number of remote connections that are currently active (i.e., they are processing a unit of work) respectively. If the number of remote connections is much larger than the number of active connections, that means most of the remote connections are idle.Idle agents and the High water mark for coordinating agents .Use the snapshot frequently to analyze and get familiar with the type of workload on the instance. Setting the agents appropriately will save system resources and increase performance.
Database Manager Snapshot
Node type = Enterprise Server Edition with
local and remote clients
Instance name = db2inst1
Number of database partitions in DB2 instance = 2
Database manager status = Active
Product name = DB2 v8.1.0.64
Service level = s040321 (U488485)
Start Database Manager timestamp = 04/22/2004
19:49:39.258796
Last reset timestamp =
Snapshot timestamp = 04/23/2004
15:04:29.606269
Remote connections to db manager = 0
Remote connections executing in db manager = 0
Local connections = 0
Local connections executing in db manager = 0
Active local databases = 0
High water mark for agents registered = 3
High water mark for agents waiting for a token = 0
Agents registered = 3
Agents waiting for a token = 0
Idle agents = 2
Agents assigned from pool = 13
Agents created from empty pool = 6
Agents stolen from another application = 0
High water mark for coordinating agents = 1
Max agents overflow = 0