Monitoring disk usage

Kognitio provides various tools for keeping track of disk usage, from both Windows (via Kognitio Console) and a Linux shell. Before reading this article, it’s important to understand <link>(how disk works) in Kognitio, in particular how disk space is divided up into slabs.

Monitoring via Console

Console is Kognitio’s Windows application. The following tools are available for monitoring disk space:

dashboard

Console’s dashboard provides a visual view of the state of disk and RAM resources. Click on view > reports > dashboard to access the dashboard view. The view shows overall disk and RAM usage as a percentage of the total available. It also shows the state of each logical disk. These terms are explained below:

Good Disks

The number of logical disks with no problems

Recreating Parity

If software RAID is being used, a logical disk may be in this state if it was e.g. replaced, and it’s contents are being recreated from the other logical disks in the same cluster

Reconfiguring

Relevant for standalone systems only, this indicates logical disks are being added or removed from the system

Configuration Needed

Recreating Data

Similar to ‘recreating parity’, this indicates the logical disk being recreated is a data disk rather than a parity disk in a software RAID cluster

Bad Disks

The logical disk is unusable in it’s current state. This could mean there’s a problem with the disk, or it could mean that the disk was recently introduced and has not commenced recreating parity.

total disk usage overview

In a query pane, pressing ctrl+f1 will bring up a query which, when run, returns the overall disk usage figures in the system.

disk usage on each node

In a query pane, pressing ctrl+f3 will bring up a query which, when run, returns the disk usage on each node, as well as the state of the diskstore(s) on each node and other information.

disk usage on each slab

In a query pane, pressing ctrl+f4 will bring up a query which, when run, returns the disk usage for each slab in the system.

disk usage for each table

In a query pane, pressing ctrl+f6 will bring up a query which, when run, returns the disk usage for each table in the system, including dropped tables.

table to slab assignments

In a query pane, pressing ctrl+f8 will bring up a query which, when run, returns a list of every table in the system, along with the slabs it is assigned to and the slabs it has data on.

Monitoring via command line

The queries mentioned above for ctrl+f1, ctrl+f4, ctrl+f6 and ctrl+f8 are all available from the command line via wxsubmit. The only difference is that they need to be run with $f1, $f4, $f6 and $f8 respectively. First connect to a system with wxsubmit

wxsubmit -s mysystem myuser;

Then type, for example, $f1 and press return

>$f1;
Disk GB  |Used GB  |Free GB  |Avail GB |% Used|% Unav
  8.5|      0.0|      8.5|      8.5|  0.0%|  0.0%
Query           1                1 row     ----   0:00.1   0:00.1   0:00.1

Note that these $f* queries all run within Kognitio Server, and only show the disk space that is usable. This usable disk space may only be a portion of the total space used on disk, due to software RAID and various overheads. For example, if a RAID cluster size of 2 is used for software RAID, the usable disk space will be slightly less than half of the total disk space used - reduced by half due to mirrored RAID, and reduced slightly after that due to overheads. To see the total disk space consumed, run wxprobe -H from a command line. An example of this is shown below

wxadmin wxadmin@node1:> wxprobe -H
Kognitio WX2 Hardware Discovery Tool v8.01.00-rel160921 on mysystem
(c)Copyright Kognitio Ltd 2001-2016.

WX2 system has: 5 nodes in 3 groups.
Disk resources: 20.0G in 4 disks.
System has 2 unique types of node.
System has 1 unique type of disk.
System RAM 161G, 129G for data processing.
32 CPUs available for data processing.

In the above output, the total disk space consumed is 20GB. However, running $f1 via wxsubmit shows a total of just 8.5GB

>$f1;
Disk GB  |Used GB  |Free GB  |Avail GB |% Used|% Unav
8.5|      0.0|      8.5|      8.5|  0.0%|  0.0%

This is because the system has a RAID cluster size of 2 (using mirrored disks), so only half of the initial 20GB is usable. After that, various overheads bring the usable space down further, to 8.5GB.

System tables

All of the above tools rely on information stored in various disk-related system tables in the SYS schema. These tables contain more detailed information on data residency:

sys.ipe_ftable

This table has rows for every table in the system, for every slab. The rows describe the number of active, deleted and truncated rows that a particular table has on a particular slab, as well as other information.

For example, if you want to know how many rows a table has on each slab, first find the table_id:

select a.id from ipe_alltable a, ipe_allschema b where a.schema_id=b.id and a.name='my_table_name_in_CAPITALS' and b.name='my_schema_name_in_CAPITALS';

then run:

select partition_id, sum(nrows) from ipe_ftable where table_id=12345 group by 1

replacing ‘12345’ with your table id. For an explanation of each field in ipe_ftable, run:

explain ipe_ftable;

As another example, you may want to know how much disk space is taken up by deleted data, so that you know how much space could be freed by a repack or reclaim. Run:

select sum(t) MB_reclaimable from (select (case when drop_tno=2147483647 then del_words+trunc_words else words+del_words+trunc_words end) /(1032*1032) as t from ipe_ftable) df;

ipe_xor_element

This table contains information on each logical disk in the system, including RAID position, status and other information.

ipe_disk_slab

Contains aggregated data statistics for each logical disk and slab.

ipe_allslabs

Contains raw information on which tables are assigned to which slabs. Using ctrl+f8 is a better way to see this.

Freeing up disk space

See Recovering disk space