---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/troubleshooting/performance/hardware/cpu-bottleneck.md?version=main
  - https://ydb.tech/docs/ru/troubleshooting/performance/hardware/cpu-bottleneck.md?version=main
sourcePath: en/core/troubleshooting/performance/hardware/cpu-bottleneck.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# CPU bottleneck

High CPU usage can lead to slow query processing and increased response times. When CPU resources are constrained, the database may have difficulty handling complex queries or large transaction volumes.

YDB nodes primarily consume CPU resources for running [actors](https://ydb.tech/docs/en/concepts/glossary.md?version=main#actor). On each node, actors are executed using multiple [actor system pools](https://ydb.tech/docs/en/concepts/glossary.md?version=main#actor-system-pools). The resource consumption of each pool is measured separately which allows to identify what kind of activity changed its behavior.

## Diagnostics

<!-- The include is added to allow partial overrides in overlays  -->
<!-- source: en/troubleshooting/performance/hardware/_includes/cpu-bottleneck.md -->
1. Use **Diagnostics** in the [Embedded UI](https://ydb.tech/docs/en/reference/embedded-ui/index.md?version=main) to analyze CPU utilization in all pools:

    1. In the [Embedded UI](https://ydb.tech/docs/en/reference/embedded-ui/index.md?version=main), go to the **Databases** tab and click on the database.

    1. On the **Navigation** tab, ensure the required database is selected.

    1. Open the **Diagnostics** tab.

    1. On the **Info** tab, click the **CPU** button and see if any pools show high CPU usage.

        ![](_assets/embedded-ui-cpu-system-pool.png)

1. Use Grafana charts to analyze CPU utilization in all pools:

    1. Open the **[CPU](https://ydb.tech/docs/en/reference/observability/metrics/grafana-dashboards.md?version=main#cpu)** dashboard in Grafana.

    1. See if the following charts show any spikes:

        - **CPU by execution pool** chart

            ![](_assets/cpu-by-pool.png)

        - **User pool - CPU by host** chart

            ![](_assets/cpu-user-pool.png)

        - **System pool - CPU by host** chart

            ![](_assets/cpu-system-pool.png)

        - **Batch pool - CPU by host** chart

            ![](_assets/cpu-batch-pool.png)

        - **IC pool - CPU by host** chart

            ![](_assets/cpu-ic-pool.png)

        - **IO pool - CPU by host** chart

            ![](_assets/cpu-io-pool.png)

1. If the spike is in the user pool, analyze changes in the user load that might have caused the CPU bottleneck. See the following charts on the **DB overview** dashboard in Grafana:

    - **Requests** chart

        ![](_assets/requests.png)

    - **Request size** chart

        ![](_assets/request-size.png)

    - **Response size** chart

        ![](_assets/response-size.png)

    Also, see all of the charts in the **Operations** section of the **DataShard** dashboard.

2. If the spike is in the batch pool, check if there are any backups running.
<!-- endsource: en/troubleshooting/performance/hardware/_includes/cpu-bottleneck.md -->

## Recommendation

Add additional [database nodes](https://ydb.tech/docs/en/concepts/glossary.md?version=main#database-node) to the cluster or allocate more CPU cores to the existing nodes. If that's not possible, consider distributing CPU cores between pools differently.
