You can view the overall CPU load on the primary cluster caching facilities in a Db2®
pureScale® instance using the ENV_CF_SYS_RESOURCES administrative
view.
Before you begin
You must be connected to a database running in a Db2
pureScale instance.
About this task
The ENV_CF_SYS_RESOURCES administrative
view returns information for all cluster caching facilities (also known as CFs) in a Db2
pureScale instance. In instances where you have more than one CF configured, one to act as the primary and the others to
serve as backup CFs running in PEER mode, the ENV_CF_SYS_RESOURCES administrative
view returns information for all CFs.
Note: The
value reported for CPU load reflects the total usage of the CPU for
actual processing performed by the CF, and for host processes other than
processes from the CF.
Procedure
To determine the CPU load on the CFs in a Db2
pureScale instance:
- Formulate an SQL statement that uses the ENV_CF_SYS_RESOURCES
administrative view.
For example:
SELECT VARCHAR(NAME,20) AS HOST_ATTRIBUTE,
VARCHAR(VALUE,25) AS VALUE,
VARCHAR(UNIT,8) AS UNIT
FROM SYSIBMADM.ENV_CF_SYS_RESOURCES
- Run the statement.
The preceding query would return the following output:
HOST_ATTRIBUTE VALUE UNIT
-------------------- ------------------------- --------
HOST_NAME HOSTA -
MEMORY_TOTAL 24108 MB
MEMORY_FREE 3504 MB
MEMORY_SWAP_TOTAL 4102 MB
MEMORY_SWAP_FREE 4063 MB
VIRTUAL_MEM_TOTAL 28211 MB
VIRTUAL_MEM_FREE 7568 MB
CPU_USAGE_TOTAL 96 PERCENT
HOST_NAME HOSTB -
MEMORY_TOTAL 24108 MB
MEMORY_FREE 3342 MB
MEMORY_SWAP_TOTAL 4102 MB
MEMORY_SWAP_FREE 4063 MB
VIRTUAL_MEM_TOTAL 28211 MB
VIRTUAL_MEM_FREE 7406 MB
CPU_USAGE_TOTAL 97 PERCENT
16 record(s) selected.
In this output, there are results
for both HOSTA and HOSTB, which indicates there are two hosts that
are configured to serve as
CFs.
- To determine which of the hosts is acting as the primary CF, you can use the DB2_CF administrative view:
SELECT VARCHAR(CURRENT_HOST,12) AS HOST,
ID,
STATE
FROM SYSIBMADM.DB2_CF
The preceding
query returns the following output:
HOST ID STATE
------------ ------ --------------------------------
HOSTA 128 PRIMARY
HOSTB 129 PEER
2 record(s) selected.
In this case, the primary host
is HOSTA, and based on the output from the command used in step
2, you can
surmise that the CPU load on the primary
CF is 96%.
What to do next
If you find your CPU usage is running at maximum capacity,
adding processors to, or upgrading your cluster caching facilities might improve system throughput. Note: For hosts with more than one logical processor,
usage numbers can exceed 100%. For example, an eight processor host
might have processor usage approach 800%.