> For the complete documentation index, see [llms.txt](https://docs.datasentinel.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasentinel.io/manual/implementation/platform-usage/configuration/backend.md). Agents can also search and read this documentation through its [MCP server](https://docs.datasentinel.io/manual/~gitbook/mcp).

# Backend

{% hint style="info" %}
The backend starts with a precomputed number of processes based on the available CPUs.

This value can be overridden by setting the number of workers in the configuration file.

Processes are automatically restarted after reaching the maximum number of handled requests\
(default: **10000**), which can also be adjusted in the configuration file.
{% endhint %}

To set custom values:

{% stepper %}
{% step %}

### <sup>Edit configuration file</sup>

```bash
/datasentinel/soft/datasentinel_backend/config/datasentinel.yml
```

{% endstep %}

{% step %}

### <sup>Set desired values</sup>

```
apis:
  workers: 15
  max_requests: 15000

```

{% endstep %}

{% step %}

### <sup>Restart backend service</sup>

```
sudo systemctl stop datasentinel_backend
sudo systemctl start datasentinel_backend
```

{% endstep %}
{% endstepper %}

***

## Purge of inactive instances

An instance is inactive when it stopped sending metrics for longer than the retention period of the metrics database. Its metrics have all expired, but it is still listed in the inventory.

The platform can remove these instances from the inventory automatically, once a day at 03:00. This is **disabled by default**.

To enable it:

{% stepper %}
{% step %}

### <sup>Edit configuration file</sup>

```bash
/datasentinel/soft/datasentinel_backend/config/datasentinel.yml
```

{% endstep %}

{% step %}

### <sup>Add the inventory section</sup>

```
inventory:
  purge_obsolete_instances: true
```

{% endstep %}

{% step %}

### <sup>Restart dispatcher service</sup>

```
sudo systemctl stop datasentinel_dispatcher
sudo systemctl start datasentinel_dispatcher
```

{% endstep %}
{% endstepper %}

At startup, the dispatcher writes the state of the purge in `/datasentinel/log/datasentinel.log`:

```
Obsolete instances purge: enabled
```

{% hint style="info" %}
You can also list and purge inactive instances by hand with the `purge_inactive_instances.sh` script. Refer to [Tooling](https://docs.datasentinel.io/manual/implementation/platform-usage/tooling.md#inactive-instances).
{% endhint %}

***

## Agentless agents

The collection settings of the [agentless](https://docs.datasentinel.io/manual/features/other-features/agentless-monitoring.md) instances are set once for the whole platform, in the `agent` section of the backend configuration file.

| Parameter                    | Default | Description                                                                                                                                                                                            | Since   |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| `tables-monitoring-limit`    | 5000    | Table and index activity is collected **only if** the number of tables in the instance is below this limit.                                                                                            | 2025.11 |
| `query-monitoring-limit`     | 30000   | Number of unique queries collected per day. Each unique query gets an ID stored in a daily cache. Above the limit, **query monitoring is disabled for the rest of the day**.                           | 2025.11 |
| `use-postgres-queryid`       | `false` | Use the PostgreSQL `queryid` instead of an MD5 hash of the text as the query identifier. Refer to [Query Identifier](https://docs.datasentinel.io/manual/features/tips-and-hints/query-identifier.md). | 2026.02 |
| `query-monitoring-min-calls` | 2       | A query of **pg\_stat\_statements** is collected if it ran at least this number of times **or** if it reached the minimum time below. Lowest value: 2.                                                 | 2026.10 |
| `query-monitoring-min-time`  | 1       | Minimum total execution time of a query, in seconds. Lowest value: 0.                                                                                                                                  | 2026.10 |

The two `query-monitoring-min-*` filters also apply to the execution plans. They are described in [Query Monitoring Filters](https://docs.datasentinel.io/manual/implementation/agent-usage/collection-level.md#query-monitoring-filters). They must be whole numbers: any other value is ignored and the default is kept. A value below the lowest value is raised to it.

{% hint style="info" %}
To collect every query of **pg\_stat\_statements**, set `query-monitoring-min-time` to **0**. It increases the number of unique queries, so check the `query-monitoring-limit`.
{% endhint %}

{% hint style="warning" %}
Parameters not set use their default values. (Refer to [Agent limit settings](https://docs.datasentinel.io/manual/implementation/agent-usage/cli.md#change-table-monitoring-limit) section for more details).
{% endhint %}

To set custom values:

{% stepper %}
{% step %}

### <sup>Edit configuration file</sup>

```bash
/datasentinel/soft/datasentinel_backend/config/datasentinel.yml
```

{% endstep %}

{% step %}

### <sup>Set desired values</sup>

```yaml
agent:
  tables-monitoring-limit: 5000
  query-monitoring-limit: 30000
  use-postgres-queryid: false
  query-monitoring-min-calls: 2
  query-monitoring-min-time: 1
```

Set only the parameters you want to change.
{% endstep %}

{% step %}

### <sup>Restart dispatcher service</sup>

```
sudo systemctl stop datasentinel_dispatcher
sudo systemctl start datasentinel_dispatcher
```

{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Custom values apply to all monitored instances using the agentless method. They are read when the dispatcher starts: restart it after each change.
{% 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://docs.datasentinel.io/manual/implementation/platform-usage/configuration/backend.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.
