> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/performance-issues.md).

# Performance issues

Steps to consider when addressing performance issues in SonarQube Server 2025.4.

{% hint style="info" %}
**For AI agents:** You're in the SonarQube Server 2025.4 documentation. For a list of all 2025.4 pages, see the [SonarQube Server 2025.4 page index](https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2FeQYQUeoPOE6lmMNkoJnI%2Fsonarqube-server-2025.4-llms.txt?alt=media). For the whole site, see the [page index](https://docs.sonarsource.com/llms.txt) or the [full text](https://docs.sonarsource.com/llms-full.txt). For another version, replace 2025.4 in the URL with that version. The [latest version](https://docs.sonarsource.com/sonarqube-server/) has no version number in its URL.
{% endhint %}

In case of performance issues, you may try the following:

* Review the [Server host requirements](https://docs.sonarsource.com/sonarqube-server/2025.4/server-installation/server-host-requirements.md) for SonarQube Server linked to **Elasticsearch** usage.
* Move the Elasticsearch storage to a storage with high IOPS and low latency. See [Basic installation](https://docs.sonarsource.com/sonarqube-server/2025.4/server-installation/from-zip-file/basic-installation.md#configure-es-storage-path) for more information.
* Set the [Housekeeping](https://docs.sonarsource.com/sonarqube-server/2025.4/instance-administration/system-functions/housekeeping.md) with a reduced retention time, to limit the database size.
* Configure the analysis scope to reduce the number of files analyzed, leading to shorter analysis and smaller database footprint. See the Analysis scope [Introduction](https://docs.sonarsource.com/sonarqube-server/2025.4/project-administration/setting-analysis-scope/introduction.md) page for more information.
* From the [Enterprise edition](https://www.sonarsource.com/plans-and-pricing/enterprise/): increase the number of Compute Engine workers and/or configure the Compute Engine to enable parallel processing of pull requests and branch analyses for each project. See [Improving performance](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/maintenance/improving-performance.md).
* For the Data Center edition on Kubernetes: set up autoscaling. See [Setting up autoscaling](https://docs.sonarsource.com/sonarqube-server/2025.4/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-autoscaling.md) for more details.
* If performance issues occur after a PostgreSQL database upgrade, try reindexing the following database tables: issues, rules, and components.

## Refresh background task queue table statistics

*This section applies to Enterprise edition and Data Center edition only.*

Each row in the `ce_queue` table corresponds to one pending or in progress background task. When the table's statistics are outdated, the database query planner can pick a plan that slows down sharply once the table holds hundreds or thousands of rows. Compute Engine workers then take much longer to find their next task, and pending tasks pile up.

Refresh the background task queue table statistics, as shown below, if you see all of the following symptoms in **Administration** > **Projects** > **Background tasks**:

* A large number of pending background tasks.
* Only a fraction of the total number of Compute Engine workers are actively processing tasks (often just one or two). To see how many workers are processing background tasks, set the **Status** filter to **In Progress**.
* Long delays (more than a few hundred milliseconds) between one task finishing and the next starting. If background task execution timing is hard to observe on the **Background tasks** page, check background task execution timestamps in `<sonarqubeHome>/logs/ce.log` (see [Server logs](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/server-logs.md)): `Executed task` messages mark the end of a task, and `Execute task` messages mark the start of a task.

This issue often occurs after a full Elasticsearch reindex, such as one an upgrade triggers, because the reindex creates many background tasks.

To resolve this issue, connect to your instance's database with a user that has the appropriate permissions (for example, the user configured in `sonar.jdbc.username`), and then run the SQL command for your database:

{% tabs %}
{% tab title="PostgreSQL" %}
Replace `<SCHEMA>` with the name of the schema that contains your SonarQube Server data. This is usually `public`.

```sql
ANALYZE <SCHEMA>.ce_queue;
```

{% endtab %}

{% tab title="Oracle" %}
Replace `<SCHEMA>` with the name of the schema that contains your SonarQube Server data.

```sql
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(
    ownname => '<SCHEMA>',
    tabname => 'CE_QUEUE',
    cascade => TRUE
  );
END;
/
```

{% endtab %}

{% tab title="Microsoft SQL Server" %}
Replace `<SCHEMA>` with the name of the schema that contains your SonarQube Server data.

```sql
UPDATE STATISTICS <SCHEMA>.ce_queue;
```

{% endtab %}
{% endtabs %}

Stop any queries on `ce_queue` still using the old query plan. Updating statistics does not change the query plan used by queries that were already running. You can terminate the running queries directly, or achieve the same effect by restarting either the database or SonarQube Server.

Then open **Administration** > **Projects** > **Background tasks** and check whether the number of pending tasks is going down.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Server logs](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/server-logs.md)
* [Database-related issues](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/database-related-issues.md)
* [Elasticsearch-related issues](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/elasticsearch.md)
* [Other issues](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/other-issues.md)
* [Improving performance](https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/maintenance/improving-performance.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/2025.4/server-update-and-maintenance/troubleshooting/performance-issues.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
