> For the complete documentation index, see [llms.txt](https://help.glpi-project.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.glpi-project.org/glpi-12/setup/general/sql_replicas.md).

# SQL replicas

GLPI can be configured to use replica databases in some cases to improve performance.

This tab is only visible if the option has been enabled in the [system tab](https://help.glpi-project.org/glpi-12/setup/general/system.md).

![View SQL Replication](https://content.gitbook.com/content/uys4bnfAs7Oe2yWUUh3p/blobs/11MDWjc06ujfyXvtbT17/replication_sql.png)

To activate the replica management, you just have to fill in the connection parameters. It is advisable to use a login that has only read privileges on the database.

You can use several replicates by separating them with a **blank space**. As the result in the config\_db\_slave.php file, the `dbhost` parameter will be an array.

A specific port can also be added.

{% hint style="warning" %}
If you use multiple replicas, the settings will apply to them all.
{% endhint %}

The SQL replicas will be used in at least the following cases:

* The main server cannot be reached. In this case, GLPI will switch to read-only mode.
* Running reports to reduce the load on the main server.

It is also possible to use replicas for the search engine depending on the option chosen.

* **Never**
* **If synced (all changes)** GLPI will check the synchronization and use the replica if all changes have been replicated.
* **If synced (current user changes)** GLPI will check the synchronization and use the replica if all the changes for the current user have been replicated. If using a read-only account, the replica will always be used.
* **If synced or read-only account** GLPI will check the synchronization and use the replica if all changes have been replicated. If using a read-only account, the replica will always be used.
* **Always**

{% hint style="danger" %}
When **always** using the replica, it is possible that the results will be **out of date**. A different option should be considered before this one.
{% endhint %}

{% hint style="info" %}
The replication configuration of your database is not set by GLPI. You still need to configure that with the appropriate tools for your database management system.
{% endhint %}


---

# 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://help.glpi-project.org/glpi-12/setup/general/sql_replicas.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.
