# Handling Too Many Connections

Systems that get too busy can return the `too_many_connections` error.

When the number of [threads\_connected](/docs/server/server-management/variables-and-modes/server-status-variables.md#threads_connected) exceeds the [max\_connections](/docs/server/server-management/variables-and-modes/server-system-variables.md#max_connections) server variable, it's time to make a change. Viewing the [threads\_connected](/docs/server/server-management/variables-and-modes/server-status-variables.md#threads_connected) status variable shows only the current number of connections, but it's more useful to see what the value has peaked at, and this is shown by the [max\_used\_connections](/docs/server/server-management/variables-and-modes/server-status-variables.md#max_used_connections) status variable.

This error may be a symptom of slow queries and other bottlenecks, but if the system is running smoothly this can be addressed by increasing the value of max\_connections.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/system-variables/handling-too-many-connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
