Last week during some performance tests on one of our PureData for Transactions Systems, we were looking at the CPU load for the system during workload execution.
In pureScale you know that the CPU stats from command line tools like top or vmstat could be not accurate to the DB2 member real load. This is due to the Cache Facility (CF) process being colocated to the DB2 member, on the same host. The process for the CF will shows most of the CPU usage even if there is not to worry about this.
To clarify this, we were using a small instance on PureData for Transactions, so 2 members and 2 CFs on two physical hosts.
Back to our CPU load... How can we measure that?
db2top? There are some CPU metrics in db2top, but can show 100% CPU load even if this is not exactly true.
Optim Performance Manager? Yes, we can check the CPU load for the system using OPM, in the Performance - Overview - Key indicators panel. We can also look at Performance - System to get the CPU usage. In PureData for Transactions this is useful as it has Optim Performance Manager already integrated into the management console.
An useful query to check the CPU load from DB2 itself and also valid for pureScale is the following:
select MEMBER, varchar(HOST_NAME,32) as HOST_NAME,
table(SYSPROC.ENV_GET_SYSTEM_RESOURCES()) order by MEMBER;
[db2sdin1@compute01 ~]$ db2 "select MEMBER, varchar(HOST_NAME,32) as HOST_NAME,
> CPU_USAGE_TOTAL from
> table(SYSPROC.ENV_GET_SYSTEM_RESOURCES()) order by MEMBER"
MEMBER HOST_NAME CPU_USAGE_TOTAL
------ -------------------------------- ---------------
0 compute01.ipds.cloud.ibm.com 19
1 compute02.ipds.cloud.ibm.com 22
2 record(s) selected.
Other useful information like this can be also gathered using SYSPROC.ENV_GET_SYSTEM_RESOURCES function: