cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.98k stars 3.79k forks source link

storage: expose additional disk usage metrics #52801

Open jbowens opened 4 years ago

jbowens commented 4 years ago

It's generally helpful to understand why disk space is being consumed. There are some circumstances where it might be nonobvious where disk usage is coming from. We could expose additional storage-level metrics to help. Ideally, these new metrics would be displayed together, in an easy-to-consume way.

There are two ~kinds of disk space metrics: physical and virtual.

Physical disk space records where disk space is consumed within a node. This includes:

  1. The sum of all tables in the current LSM version.
  2. sum of all output tables from active compactions cockroachdb/pebble#862
  3. sum of zombie tables pinned by open iterators
  4. sum of staged sideloaded sstables
  5. sum of SQL temporary data
  6. files outside those managed by Cockroach

Typically, the first item above holds almost all the consumed disk space. While it's not really feasible to further divide it in terms of physical disk space, we can expose statistics about the logical size of data that it stores. We generally expect logical and physical bytes to correlate, but some data may be much more compressible and consume less disk space than the logical numbers suggest. There are a few axises through which logical data can be broken down:

Maybe two stacked line charts would be useful: one for physical disk usage and one for logical usage?

Jira issue: CRDB-3917

Epic CRDB-40360

blathers-crl[bot] commented 4 years ago

Hi @jbowens, please add a C-ategory label to your issue. Check out the label system docs.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

dshjoshi commented 1 week ago

@nicktrav Is this done? if so please close.

nicktrav commented 1 week ago

Let's keep this open.