Monitoring ClustrixDB CPU using External Tools

John Sheaffer -

Versions: 7.0

When monitoring ClustrixDB to determine how heavily loaded the cluster is, the most relevant metric to monitor is: Average CPU Used %, tracked as Average Load (clustrix.cpu.load_avg) in statd.

The average CPU metric is the average of the CPU usage across all cores in the cluster. Average Load is more relevant than maximum load (aka. maximum CPU Used %) because at any instant in time one or more cores in the cluster will be at 100% while others are lightly used, but the next instant in time the previously busy cores may be lightly used while other cores are 100% busy. Therefore, we monitor the average load, and when it is consistently high we know we have a cluster that is consistently using the CPUs heavily.

You can view ClustrixDB's average load using the Clustrix Insight web UI. But if you wish to use external tools to monitor ClustrixDB, you will want to configure the external tool to issue SQL queries to gather the metric.

Measure CPU Load Within ClustrixDB

It is important to note that to accurately measure the amount of CPU ClustrixDB is using, the measurement should be taken from within the ClustrixDB software and not from the point-of-view of the operating system.  

Querying the database directly allows you to see the CPU usage of every node in the cluster and get a better overall picture of usage.

Instantaneous Average CPU Load

To measure the instantaneous average CPU load (i.e. current point in time), you can configure the external tool to run the following query. This will return a % value between 0 and 1 (i.e. 30% avg CPU used will be returned as 0.30). 

select avg(1-idle) as avg_cpu_pct from system.cpu_activity;

Historical Average CPU Load

Alternatively, if you want to run a query to see the recent average CPU history, you can retrieve this history from ClustrixDB directly using the query below. Similarly, the "value" column of this query will be a % value between 0 and 1 (i.e. 30% CPU used is 0.30).

select timestamp, value 
from clustrix_statd.statd_history
natural join clustrix_statd.statd_metadata
where name = 'clustrix.cpu.load_avg'
order by timestamp desc;

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk