IBM Support

DB2 Agent high CPU usage

Question & Answer


Question

Customer detected that the APM agent is causing high CPU usage in this two servers and needs to know why.We suspect diaglog attribute collection might be causing high CPU utilization issue. To confirm the understanding please disable the collection for diaglog attribute group by setting KUD_DISABLE_DIAGLOG=Y We suspect diaglog attribute collection might be causing high CPU utilization issue. To confirm the understanding please disable the collection for diaglog attribute group by setting KUD_DISABLE_DIAGLOG=Y 

Cause

We suspected the diaglog attribute collection might be causing high CPU utilization issue. To confirm, we had the customer to disable the collection for diaglog attribute group by setting KUD_DISABLE_DIAGLOG=Y 

In “<db2agent_install_dir>/config/ud.environment” file,

Modify the KUD_DISABLE_DIAGLOG variable as,

KUD_DISABLE_DIAGLOG =Y

Once customer did this the CPU was not as high.

Answer

Customer wanted to know what this kud diaglog collects and and what is lost if it is disabled?

The DB2 agent has a predefined situation “UDB_Log_Diag_Msg_Crit” defined on KUD_DB2_Diagnostic_Log attribute group.

This situation Issues a critical alert if the severity level of the log record is critical in db2diag.log file.

If you disable diagnostic log collection then this situation will not work.

 

However, if you really want to collect db2diag log data then you can switch to ‘parsing db2diag.log file’ data collection approach.  And check if this approach helps to minimize CPU usage.

 

Basically the DB2 agent collects diagnostic log data by two approaches.

 

1) By using DB2 table function, by default this method is used to collect diagnostic data.

In your environment, (before disabling diagnostic collection) this default collection approach is used; i.e. using DB2 table function.

In this approach diagnostic data is fetched using SQL query (from PD_GET_DIAG_HIST API).

When there are a lot of records, this can take a considerable amount of CPU time. This behavior has been introduced since the support for DB2 10.1.

  

2) By parsing db2diag.log file where agent parses the db2diag.log file to get diagnostic log data, this can be enabled by setting KUD_DIAGLOG_BY_TABLE=N in configuration file.

To switch data collection approach please follow below steps:

a) Stop DB2 agent, if running.

b) In <agent-installed-directory>.ud.environment file, Add/ modify-

KUD_DIAGLOG_BY_TABLE=N

c) Save file

d) Start Db2 agent

 

Also, you can adjust the monitoring interval (30 seconds by default) for db2diag.log by setting: KUD_DIAGLOG_INTERVAL=xxx,

       where xxx is the wanted interval.

Note: Please enable diagnostic collection before switching to parsing db2diag.log approach.

 

Modify KUD_DISABLE_DIAGLOG variable to KUD_DISABLE_DIAGLOG =N

 

[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSVJUL","label":"IBM Application Performance Management"},"ARM Category":[{"code":"a8m500000008axBAAQ","label":"APM Agents"}],"ARM Case Number":"TS004634079","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Product Synonym

APM DB2

Document Information

Modified date:
11 February 2021

UID

ibm16414683