Skip to main content
In earlier versions, there are no rich metrics or efficient methods to monitor the performance, usage, and health of Data Cache. In v3.3, the database improves the observability of Data Cache by offering efficient monitoring methods and more metrics. Users can now check the overall disk and memory usage of the data cache, and related metrics, enhancing monitoring of cache usage.
NOTE From v3.4.0 onwards, queries against external catalogs and cloud-native tables (in shared-data clusters) use a unified Data Cache instance. Therefore, unless otherwise specified, the following methods default to displaying the metrics of the Data Cache instance itself, which includes the cache usage of queries against both external catalogs and cloud-native tables.

SQL commands

You can run SQL commands to view the capacity and usage of Data Cache on each BE node.

SHOW BACKENDS

The DataCacheMetrics field records the used disk and memory space of Data Cache on a specific BE.

information_schema

The be_datacache_metrics view in information_schema records the following Data Cache-related information.
  • BE_ID: the BE ID
  • STATUS: the BE status
  • DISK_QUOTA_BYTES: the disk cache capacity configured by users, in bytes
  • DISK_USED_BYTES: the disk cache space that has been used, in bytes
  • MEM_QUOTA_BYTES: the memory cache capacity configured by users, in bytes
  • MEM_USED_BYTES: the memory cache space that has been used, in bytes
  • META_USED_BYTES: the space used to cache metadata
  • DIR_SPACES: the cache path and its cache size

API call

Since v3.3.2, the database provides two APIs to get cache metrics, which reflect the cache state at different levels:
  • /api/datacache/app_stat: Query the Block Cache and Page Cache hit rates.
  • /api/datacache/stat: the underlying execution state of Data Cache. This interface is mainly used for maintenance and bottleneck identification of Data Cache. It does not reflect the actual hit rate of the query. Common users do not need to pay attention to this interface.

View cache hit metrics

View the cache hit metrics by accessing the following API interface:
Return:

View the underlying execution state of Data Cache

You can get more detailed metrics on the Data Cache by accessing the following API interfaces.
The results are as follows:

Metric description