> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Issues to Monitor

This page summarizes how to configure and monitor your cluster to prevent issues commonly encountered with:

* [CPU](#cpu)
* [Memory](#memory)
* [Storage and disk I/O](#storage-and-disk-i/o)

## CPU

> [!NOTE]
>
> In our sizing and production guidance, 1 vCPU is considered equivalent to 1 core in the underlying hardware platform.

Issues with CPU most commonly arise when there is insufficient CPU to support the scale of the workload.

### CPU planning

Provision enough CPU to support your operational and workload concurrency requirements:

| Category | Recommendations |
| - | - |
| CPU | <ul><li>For cluster stability, Cockroach Labs recommends a *minimum* of **8 vCPUs**, and strongly recommends no fewer than **4 vCPUs** per node. In a cluster with too few CPU resources, foreground client workloads will compete with the cluster's background maintenance tasks.</li><li>Cockroach Labs does not extensively test clusters with more than **64 vCPUs** per node. This is the recommended *maximum* threshold.</li><li>Use larger VMs to handle temporary workload spikes and processing [hotspots](https://docs.cockroachlabs.com/docs/stable/understand-hotspots.md).</li><li>Use connection pooling to manage workload concurrency. The number of **active** connections across all connection pools **should not exceed 4 times the number of vCPUs** in the cluster by a large amount. A connection is "active" when it is actively executing a query. To monitor active connections, use the [**Active SQL Statements** graph and `sql.statements.active` metric](https://docs.cockroachlabs.com/docs/stable/connection-pooling#monitor-active-connections). For more details, refer to [Size connection pools](https://docs.cockroachlabs.com/docs/stable/connection-pooling.md#size-connection-pools).</li><li>For additional CPU recommendations, refer to [Recommended Production Settings](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#sizing).</li></ul> |

### CPU monitoring

Monitor possible signs of CPU starvation:

| Parameter | Description |
| - | - |
| [Service latency](#service-latency) | The time between when the cluster receives a query and finishes executing the query. |
| [CPU usage](#cpu-usage) | The CPU consumption by the CockroachDB node process. |
| [Workload concurrency](#workload-concurrency) | The number of SQL statements being executed on the cluster at the same time. |
| [LSM health](#lsm-health) | The health of the persistent stores. |
| [Node health](#node-health) | The operational status of the nodes. |

#### Service latency

Degradation in SQL response time is the most common symptom of CPU starvation. It can also be a symptom of [insufficient disk I/O](#storage-and-disk-i/o).

* The [**Service Latency: SQL Statements, 99th percentile**](https://docs.cockroachlabs.com/docs/stable/ui-sql-dashboard.md#service-latency-sql-99th-percentile) and [**Service Latency: SQL Statements, 90th percentile**](https://docs.cockroachlabs.com/docs/stable/ui-sql-dashboard.md#service-latency-sql-90th-percentile) graphs on the SQL dashboard show the time in nanoseconds between when the cluster [receives a query and finishes executing the query](https://docs.cockroachlabs.com/docs/stable/architecture/sql-layer.md). This time does not include returning results to the client.

If latencies are consistently high, check for:

* High [CPU usage](#cpu-usage).
* An [I/O bottleneck](#disk-iops).

#### CPU usage

[Compaction on the storage layer](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#compaction) uses CPU to run concurrent worker threads.

* The [**CPU Utilization**](https://docs.cockroachlabs.com/docs/stable/ui-overload-dashboard.md#cpu-utilization) graph on the Hardware and Overload dashboards shows the CPU consumption by the CockroachDB process, and excludes other processes on the node.

  **Expected values for a healthy cluster**: CPU utilized by CockroachDB should not persistently exceed 80%. Because this metric does not reflect system CPU usage, values above 80% suggest that actual CPU utilization is nearing 100%.

If CPU usage is high, check whether [workload concurrency](#workload-concurrency) is exceeding CPU resources.

By default, the [storage engine](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md) uses a compaction concurrency of 3. If you have sufficient IOPS and CPU headroom, you can consider increasing this setting via the `COCKROACH_COMPACTION_CONCURRENCY` environment variable. This may help to reshape the LSM more quickly in [inverted LSM](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#inverted-lsms) scenarios; and it can lead to increased overall performance for some workloads. Cockroach Labs **strongly recommends** testing your workload against non-default values of this setting.

#### Workload concurrency

The number of concurrent active SQL statements should be proportionate to your provisioned CPU.

* The [**SQL Queries Per Second**](https://docs.cockroachlabs.com/docs/stable/ui-sql-dashboard.md#sql-queries-per-second) graph on the Overview and SQL dashboards shows the 10-second moving average of `SELECT`, `UPDATE`, `INSERT`, and `DELETE` statements being executed per second on the cluster or node, as well as `Total queries`. The latest QPS value for the cluster is also displayed with the **Queries per second** counter on the Metrics page.

  **Expected values for a healthy cluster**: At any time, the total number of connections actively executing SQL statements should not exceed 4 times the number of vCPUs in the cluster. You can find them in the Active Executions view in the [DB Console](https://docs.cockroachlabs.com/docs/stable/ui-statements-page.md) or [Cloud Console](https://docs.cockroachlabs.com/docs/cockroachcloud/statements-page.md). You can find the number of open connections in the [DB Console](https://docs.cockroachlabs.com/docs/stable/ui-sql-dashboard.md#open-sql-sessions) or [Cloud Console](https://docs.cockroachlabs.com/docs/cockroachcloud/metrics-sql.md#open-sql-sessions). For more details on configuring connection pools, see [Size connection pools](https://docs.cockroachlabs.com/docs/stable/connection-pooling.md#size-connection-pools).

If workload concurrency exceeds CPU resources, you will observe:

* High [CPU usage](#cpu-usage).
* Degradation in [SQL response time](#service-latency).
* Over time, an [unhealthy LSM](#lsm-health) and [cluster instability](#node-health).

To prevent issues with workload concurrency, [provision sufficient CPU](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#sizing) and use [connection pooling](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#connection-pooling) for the workload.

#### LSM health

Issues at the storage layer, including an [inverted LSM](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#inverted-lsms) and high [read amplification](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#read-amplification), can be observed when [compaction](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#compaction) falls behind due to insufficient CPU or excessively high [recovery and rebalance rates](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#excessive-snapshot-rebalance-and-recovery-rates).

* The [**IO Overload**](https://docs.cockroachlabs.com/docs/stable/ui-overload-dashboard.md#io-overload) graph on the Overload dashboard shows the health of the [persistent stores](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md), which are implemented as log-structured merge (LSM) trees. Level 0 is the highest level of the LSM tree and consists of files containing the latest data written to the [Pebble storage engine](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md#storage-engine). For more information about LSM levels and how LSMs work, see [Log-structured Merge-trees](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#log-structured-merge-trees).

  **Expected values for a healthy cluster**: An IO Overload value greater than 1.0 generally indicates an overload in the Pebble LSM tree. High values indicate heavy write load that is causing accumulation of files in level 0. These files are not being compacted quickly enough to lower levels, resulting in a [misshapen LSM](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#inverted-lsms).

> [!NOTE]
>
> An unhealthy LSM can be caused by other factors, including [under-provisioned storage](#storage-and-disk-i/o). To correlate this symptom with CPU starvation, check for high [CPU usage](#cpu-usage) and excessive [workload concurrency](#workload-concurrency).

* The **Read Amplification** graph on the [Storage Dashboard](https://docs.cockroachlabs.com/docs/stable/ui-storage-dashboard.md) shows the average number of disk reads per logical SQL statement, also known as the [read amplification](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#read-amplification) factor.

  **Expected values for a healthy cluster**: Read amplification factor should be in the single digits. A value exceeding 50 for 1 hour strongly suggests that the LSM tree has an unhealthy shape.

* The `STORAGE` [logging channel](https://docs.cockroachlabs.com/docs/stable/logging-overview.md#logging-channels) indicates an unhealthy LSM with the following:

  * Frequent `compaction` status messages.

  * High-read-amplification warnings, e.g., `sstables (read amplification = 54)`.

If compaction has fallen behind and caused an [inverted LSM](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#inverted-lsms), throttle your workload concurrency to allow [compaction](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#compaction) to catch up and restore a healthy LSM shape. The number of **active** connections across all connection pools **should not exceed 4 times the number of vCPUs** in the cluster by a large amount. A connection is "active" when it is actively executing a query. To monitor active connections, use the [**Active SQL Statements** graph and `sql.statements.active` metric](https://docs.cockroachlabs.com/docs/stable/connection-pooling#monitor-active-connections). If a node is severely impacted, you can [start a new node](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md) and then [decommission the problematic node](https://docs.cockroachlabs.com/docs/stable/node-shutdown.md?filters=decommission#remove-nodes). By default, the [storage engine](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md) uses a compaction concurrency of 3. If you have sufficient IOPS and CPU headroom, you can consider increasing this setting via the `COCKROACH_COMPACTION_CONCURRENCY` environment variable. This may help to reshape the LSM more quickly in [inverted LSM](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#inverted-lsms) scenarios; and it can lead to increased overall performance for some workloads. Cockroach Labs **strongly recommends** testing your workload against non-default values of this setting.

#### Node health

If [issues at the storage layer](#lsm-health) remain unresolved, affected nodes will eventually become unresponsive.

* The [**Node status**](https://docs.cockroachlabs.com/docs/stable/ui-cluster-overview-page.md#node-status) on the Cluster Overview page indicates whether nodes are online (`LIVE`) or have crashed (`SUSPECT` or `DEAD`).

* The `/health` endpoint of the [Cluster API](https://docs.cockroachlabs.com/docs/stable/cluster-api.md) returns a `500` error when a node is unhealthy.

* A [Prometheus alert](https://docs.cockroachlabs.com/docs/stable/monitoring-and-alerting.md#node-is-down) can notify when a node has been down for 15 minutes or more.

If nodes have shut down, this can also be caused by [insufficient storage capacity](#storage-capacity).

> [!NOTE]
>
> If the cluster becomes unavailable, the DB Console and Cluster API will also become unavailable. You can continue to monitor the cluster via the [Prometheus endpoint](https://docs.cockroachlabs.com/docs/stable/prometheus-endpoint.md) and [logs](https://docs.cockroachlabs.com/docs/stable/logging-overview.md).

## Memory

CockroachDB is [resilient](https://docs.cockroachlabs.com/docs/stable/demo-cockroachdb-resilience.md) to node crashes. However, frequent node restarts caused by [out-of-memory (OOM) crashes](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#out-of-memory-oom-crash) can impact cluster stability and performance.

### Memory planning

Provision enough memory and allocate an appropriate portion for data caching:

* Provision at least **4 GiB of RAM per vCPU**.

* Disable Linux memory swapping. Over-allocating memory on production machines can lead to unexpected performance issues when pages have to be read back into memory.

* The default value for `--cache` is 128 MiB. For production deployments, set `--cache` to `25%` or higher. To determine appropriate settings for `--cache` and `--max-sql-memory`, use the following formula: <pre>`(2 * --max-sql-memory) + --cache <= 80% of system RAM
  `</pre>

To help guard against [OOM events](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#out-of-memory-oom-crash), CockroachDB sets a soft memory limit using mechanisms in Go. Depending on your hardware and workload, you may not need to manually tune `--max-sql-memory`.

Test the configuration with a reasonable workload before deploying it to production.

> [!NOTE]
>
> On startup, if CockroachDB detects that `--max-sql-memory` or `--cache` are set too aggressively, a warning is logged.

For additional memory recommendations, refer to [Recommended Production Settings: Memory](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#memory) and [Recommended Production Setting: Cache and SQL memory size](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#cache-and-sql-memory-size).

### Memory monitoring

Monitor memory usage and node behavior for [OOM errors](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#out-of-memory-oom-crash):

| Metric or event | Description |
| - | - |
| [Node process restarts](#node-process-restarts) | Nodes restarting after crashes |
| [SQL memory usage](#sql-memory-usage) | The memory allocated to the SQL layer |
| [Database memory usage](#database-memory-usage) | The memory in use by CockroachDB processes |

#### Node process restarts

CockroachDB attempts to restart nodes after they crash. Nodes that frequently restart following an abrupt process exit may point to an underlying memory issue.

* The [**Node status**](https://docs.cockroachlabs.com/docs/stable/ui-cluster-overview-page.md#node-status) on the Cluster Overview page indicates whether nodes are online (`LIVE`) or have crashed (`SUSPECT` or `DEAD`).

* When deploying on [Kubernetes](https://docs.cockroachlabs.com/docs/stable/kubernetes-overview.md), the `kubectl get pods` output contains a `RESTARTS` column that tracks the number of restarts for each CockroachDB pod.

* The `OPS` [logging channel](https://docs.cockroachlabs.com/docs/stable/logging-overview.md#logging-channels) will record a [`node_restart` event](https://docs.cockroachlabs.com/docs/stable/eventlog#node_restart) whenever a node rejoins the cluster after being offline.

* A [Prometheus alert](https://docs.cockroachlabs.com/docs/stable/monitoring-and-alerting.md#node-is-restarting-too-frequently) can notify when a node has restarted more than once in the last 10 minutes.

##### Verify OOM errors

If you observe nodes frequently restarting, confirm that the crashes are caused by [OOM errors](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#out-of-memory-oom-crash):

* Monitor `dmesg` to determine if a node crashed because it ran out of memory:

  ```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
  $ sudo dmesg | grep -iC 3 "cockroach"
  ```

  The following output indicates the node crashed due to insufficient memory:

  ```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
  $ host kernel: Out of Memory: Killed process <process_id> (cockroach).
  ```

* When deploying on [Kubernetes](https://docs.cockroachlabs.com/docs/stable/kubernetes-overview.md), run `kubectl logs {pod-name}` and look for OOM errors in the log messages.

To prevent OOM crashes, [provision sufficient memory](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#memory). If all CockroachDB machines are provisioned and configured correctly, either run the CockroachDB process on another node with sufficient memory, or [reduce the memory allocated to CockroachDB](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#cache-and-sql-memory-size).

If you confirm that nodes are crashing due to OOM errors, also check whether [SQL queries](#sql-memory-usage) may be responsible.

#### SQL memory usage

An untuned SQL query can consume significant resources and impact the performance of other workloads.

* The [**SQL Memory**](https://docs.cockroachlabs.com/docs/stable/ui-sql-dashboard.md#sql-memory) graph on the SQL dashboard shows the current amount of memory in KiB allocated to the SQL layer.

  **Expected values for a healthy cluster**: This value should not exceed the [`--max-sql-memory`](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings#cache-and-sql-memory-size) size. A healthy threshold is 75% of allocated `--max-sql-memory`.

* The "active query dump", enabled by default with the `diagnostics.active_query_dumps.enabled` [cluster setting](https://docs.cockroachlabs.com/docs/stable/cluster-settings.md), is a record of anonymized active queries that is written to disk when a node is detected to be under memory pressure.

  You can use the active query dump to correlate specific queries to OOM crashes. Active query dumps have the filename `activequeryprof.{date-and-time}.csv` and are found in the `heap_profiler` directory in the configured [logging directory](https://docs.cockroachlabs.com/docs/stable/configure-logs.md#logging-directory). They are also included when running [`cockroach debug zip`](https://docs.cockroachlabs.com/docs/stable/cockroach-debug-zip).

* A `SHOW STATEMENTS` statement can [identify long-running queries](https://docs.cockroachlabs.com/docs/stable/manage-long-running-queries.md#identify-long-running-queries) on the cluster that may be consuming excessive memory.

* A [`memory budget exceeded`](https://docs.cockroachlabs.com/docs/stable/common-errors#memory-budget-exceeded) error in the logs indicates that `--max-sql-memory`, the memory allocated to the SQL layer, was exceeded by the operation referenced in the error. For guidance on resolving this issue, see [Common Errors](https://docs.cockroachlabs.com/docs/stable/common-errors.md#memory-budget-exceeded).

If you find queries that are consuming too much memory, [cancel the queries](https://docs.cockroachlabs.com/docs/stable/manage-long-running-queries.md#cancel-long-running-queries) to free up memory usage. For information on optimizing query performance, see [SQL Performance Best Practices](https://docs.cockroachlabs.com/docs/stable/performance-best-practices-overview.md).

We **strongly recommend** adding size limits to all [indexed columns](https://docs.cockroachlabs.com/docs/stable/indexes.md), which includes columns in [primary keys](https://docs.cockroachlabs.com/docs/stable/primary-key.md).

Values exceeding 1 MiB can lead to [storage layer write amplification](https://docs.cockroachlabs.com/docs/stable/architecture/storage-layer.md#write-amplification) and cause significant performance degradation or even [crashes due to OOMs (out of memory errors)](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#out-of-memory-oom-crash).

To add a size limit using [`CREATE TABLE`](https://docs.cockroachlabs.com/docs/stable/create-table):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
CREATE TABLE name (first STRING(100), last STRING(100));
```

To add a size limit using [`ALTER TABLE ... ALTER COLUMN`](https://docs.cockroachlabs.com/docs/stable/alter-table#alter-column):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
ALTER TABLE name ALTER first TYPE STRING(99);
```

#### Database memory usage

CockroachDB memory usage includes both accounted memory, such as the amount allocated to `--cache` and `--max-sql-memory`; and unaccounted memory, such as uncollected Go garbage and process overhead.

* The [**Memory Usage**](https://docs.cockroachlabs.com/docs/stable/ui-runtime-dashboard.md#memory-usage) graph on the Runtime dashboard shows the total memory in use by CockroachDB processes. The RSS (resident set size) metric represents actual CockroachDB memory usage from the OS/Linux/pod point of view. The Go and CGo metrics represent memory allocation and total usage from a CockroachDB point of view.

  **Expected values for a healthy cluster**: Go Allocated will depend on workload but should not exceed [`--max-sql-memory`](https://docs.cockroachlabs.com/docs/stable/cockroach-start#flags) by more than 100%. CGo Allocated should not exceed the [`--cache`](https://docs.cockroachlabs.com/docs/stable/cockroach-start#flags) size and CGo Total should not exceed the [`--cache`](https://docs.cockroachlabs.com/docs/stable/cockroach-start#flags) size by more than 15%.

For more context on acceptable memory usage, see [Suspected memory leak](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#suspected-memory-leak).

## Storage and disk I/O

The cluster will underperform if storage is not provisioned or configured correctly. This can lead to further issues such as [disk stalls](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#disk-stalls) and node shutdown.

### Storage and disk planning

Provision enough storage capacity for CockroachDB data, and configure your volumes to maximize disk I/O:

| Category | Recommendations |
| - | - |
| Storage | - Provision volumes with **320 GiB per vCPU**. - Use dedicated volumes for the CockroachDB [store](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md#store). Do not share the store volume with any other I/O activity. - Determine where CockroachDB [log files](https://docs.cockroachlabs.com/docs/stable/configure-logs.md#logging-directory) will be stored: either on the same volume as the main data store or on a separate volume from the main data store. Refer to [Storage considerations for file sinks](https://docs.cockroachlabs.com/docs/stable/logging-best-practices.md#storage-considerations-for-file-sinks) in Logging Best Practices. - See additional storage recommendations in the [Recommended Production Settings](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#storage). |
| Disk I/O | - Disks must be able to achieve **500 IOPS and 30 MB/s per vCPU**. - Do not use LVM in the I/O path. Dynamically resizing CockroachDB store volumes can result in significant performance degradation. Using LVM snapshots in lieu of CockroachDB [backup and restore](https://docs.cockroachlabs.com/docs/stable/take-full-and-incremental-backups.md) is also not supported. Use [multiple stores per node](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md#store) instead. - See additional disk I/O recommendations in the [Recommended Production Settings](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md). |

### Storage and disk monitoring

Monitor storage capacity and disk performance:

| Metric or event | Description |
| - | - |
| [Storage capacity](#storage-capacity) | The available and used disk capacity in the CockroachDB [store](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md#store). |
| [Disk IOPS](#disk-iops) | The I/O requests per second. |
| [Node heartbeat latency](#node-heartbeat-latency) | The time between [node liveness](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#node-liveness-issues) heartbeats. |
| [Command commit latency](#command-commit-latency) | The speed at which [Raft commands](https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer.md) are being committed by nodes in the cluster. |

#### Storage capacity

CockroachDB requires disk space in order to accept writes. When a node runs out of disk space, it [shuts down](#node-health) and cannot be restarted until space is freed up.

* The [**Capacity**](https://docs.cockroachlabs.com/docs/stable/ui-storage-dashboard.md#capacity) graph on the Overview and Storage dashboards shows the available and used disk capacity in the CockroachDB [store](https://docs.cockroachlabs.com/docs/stable/cockroach-start.md#store).

  **Expected values for a healthy cluster**: Used capacity should not persistently exceed 80% of the total capacity.

* A [Prometheus alert](https://docs.cockroachlabs.com/docs/stable/monitoring-and-alerting.md#node-is-running-low-on-disk-space) can notify when a node has less than 15% of free space remaining.

> [!TIP]
>
> Ensure that you [provision sufficient storage](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#storage). If storage is correctly provisioned and is running low, CockroachDB automatically creates an emergency ballast file that can free up space. For details, see [Disks filling up](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#disks-filling-up).

For instructions on how to free up disk space as quickly as possible after dropping a table, see [How can I free up disk space that was used by a dropped table?](https://docs.cockroachlabs.com/docs/stable/operational-faqs.md#how-can-i-free-up-disk-space-when-dropping-a-table)

#### Disk IOPS

Insufficient disk I/O can cause [poor SQL performance](#service-latency) and potentially [disk stalls](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md#disk-stalls).

* The [**Disk Ops In Progress**](https://docs.cockroachlabs.com/docs/stable/ui-hardware-dashboard.md#disk-ops-in-progress) graph on the Hardware dashboard shows the number of disk reads and writes in queue.

  **Expected values for a healthy cluster**: This value should be 0 or single-digit values for short periods of time. If the values persist in double digits, you may have an I/O bottleneck.

* The Linux tool `iostat` (part of `sysstat`) can be used to monitor IOPS. In the device status output, `avgqu-sz` corresponds to the **Disk Ops In Progress** metric. If service times persist in double digits on any node, this means that your storage device is saturated and is likely under-provisioned or misconfigured.

With insufficient disk I/O, you may also see:

* Degradation in [SQL response time](#service-latency).
* An [unhealthy LSM](#lsm-health).

#### Node heartbeat latency

* The [**Node Heartbeat Latency: 99th percentile**](https://docs.cockroachlabs.com/docs/stable/ui-distributed-dashboard.md#node-heartbeat-latency-99th-percentile) and [**Node Heartbeat Latency: 90th percentile**](https://docs.cockroachlabs.com/docs/stable/ui-distributed-dashboard.md#node-heartbeat-latency-90th-percentile) graphs on the [Distributed Dashboard](https://docs.cockroachlabs.com/docs/stable/ui-distributed-dashboard.md) show the time elapsed between node heartbeats.

  **Expected values for a healthy cluster**: Less than 100ms in addition to the [network latency](https://docs.cockroachlabs.com/docs/stable/ui-network-latency-page.md) between nodes in the cluster.

For the purposes of [Raft replication](https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer.md#raft) and determining the [leaseholder](https://docs.cockroachlabs.com/docs/stable/architecture/overview.md) of a [range](https://docs.cockroachlabs.com/docs/stable/architecture/overview.md), node health is no longer determined by heartbeating a single "liveness range"; instead it is determined using [Leader leases](https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer.md#leader-leases).

However, node heartbeats of a single range are still used to determine:

* Whether a node is still a member of a cluster (this is used by [`cockroach node decommission`](https://docs.cockroachlabs.com/docs/stable/cockroach-node#node-decommission)).
* Whether a node is dead (in which case [its leases will be transferred away](https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer.md#how-leases-are-transferred-from-a-dead-node)).
* How to avoid placing replicas on dead, decommissioning or unhealthy nodes, and to make decisions about lease transfers.

#### Command commit latency

* The **Command Commit Latency: 50th percentile** and **Command Commit Latency: 99th percentile** graphs on the [Storage dashboard](https://docs.cockroachlabs.com/docs/stable/ui-storage-dashboard.md) show how quickly [Raft commands](https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer.md) are being committed by nodes in the cluster. This is a good signal of I/O load.

  **Expected values for a healthy cluster**: On SSDs ([strongly recommended](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md#storage)), this should be between 1 and 100 milliseconds. On HDDs, this should be no more than 1 second.

## See also

* [Recommended Production Settings](https://docs.cockroachlabs.com/docs/stable/recommended-production-settings.md)
* [Monitoring and Alerting](https://docs.cockroachlabs.com/docs/stable/monitoring-and-alerting.md)
* [Common Errors and Solutions](https://docs.cockroachlabs.com/docs/stable/common-errors.md)
* [Operational FAQs](https://docs.cockroachlabs.com/docs/stable/operational-faqs.md)
* [Performance Tuning Recipes](https://docs.cockroachlabs.com/docs/stable/performance-recipes.md)
* [Troubleshoot Cluster Setup](https://docs.cockroachlabs.com/docs/stable/cluster-setup-troubleshooting.md)
* [Troubleshoot SQL Behavior](https://docs.cockroachlabs.com/docs/stable/query-behavior-troubleshooting.md)
* [Admission Control](https://docs.cockroachlabs.com/docs/stable/admission-control.md)
* [Metrics](https://docs.cockroachlabs.com/docs/stable/metrics.md)
* [Alerts Page](https://docs.cockroachlabs.com/docs/cockroachcloud/alerts-page.md) (CockroachDB Advanced)
