> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/running-a-server/performance-and-metrics.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Performance and metrics

If your server lags, or you just want to watch it, this page shows where to look and what to turn down.

## Simulation

The server runs the simulation at 20 ticks per second, so a tick has a budget of 50 ms. One thread owns the game state. I kept it single-threaded so the rules stay simple and plugins do not need locks. Disk work runs on a storage thread and chunk generation on workers, so a slow disk does not slow the tick.

A tick that takes more than 50 ms counts as slow.

In game or in the console:

| Command  | Shows                                                               |
| -------- | ------------------------------------------------------------------- |
| `tps`    | Ticks per second now and over 1, 5 and 15 minutes.                  |
| `mspt`   | Mean, 95th and 99th percentile tick time, slow ticks and overloads. |
| `gc`     | Heap, non-heap and collector figures.                               |
| `health` | A one-line summary.                                                 |

## Settings that matter

| Setting                             | Effect                                                                           |
| ----------------------------------- | -------------------------------------------------------------------------------- |
| `server.view_distance`              | Chunks streamed around each player. The largest cost per player. Lower it first. |
| `server.entity_tracking_range`      | How far players see entities.                                                    |
| `creatures.per_player`              | Wild creatures kept near each player.                                            |
| `creatures.enabled`                 | Turn natural spawning off.                                                       |
| `storage.autosave_interval_seconds` | How often modified chunks are saved.                                             |
| `network.compression.*`             | CPU against bandwidth.                                                           |
| `JAVA_OPTS`                         | Set `-Xms` and `-Xmx` to the same value on a dedicated machine.                  |

## Prometheus endpoint

```yaml
metrics:
  enabled: true
  bind_address: 127.0.0.1
  port: 9464
```

`GET /metrics` answers in the Prometheus text format. Only `GET` and `HEAD` are accepted: another method gets `405`, and any other path gets `404`. Keep the endpoint on loopback or a private network.

```yaml
# prometheus.yml
scrape_configs:
  - job_name: aethercube
    static_configs:
      - targets: ["127.0.0.1:9464"]
```

| Metric                                      | Labels           | Meaning                                  |
| ------------------------------------------- | ---------------- | ---------------------------------------- |
| `aethercube_tps`                            | `window`         | Ticks per second.                        |
| `aethercube_mspt_milliseconds`              | `stat`           | Tick duration statistics.                |
| `aethercube_ticks_total`                    |                  | Ticks run.                               |
| `aethercube_slow_ticks_total`               |                  | Ticks over 50 ms.                        |
| `aethercube_players`                        |                  | Players online.                          |
| `aethercube_connections`                    |                  | Open connections.                        |
| `aethercube_network_received_bytes_total`   |                  | Bytes received.                          |
| `aethercube_network_sent_bytes_total`       |                  | Bytes sent.                              |
| `aethercube_network_rejected_packets_total` |                  | Packets refused.                         |
| `aethercube_simulation_queue`               |                  | Inbound work waiting for the simulation. |
| `aethercube_chunks_loaded`                  |                  | Chunks in memory.                        |
| `aethercube_chunks_unsaved`                 |                  | Modified chunks not yet saved.           |
| `aethercube_generation_jobs`                |                  | Chunks being generated.                  |
| `aethercube_chunks_saved_total`             |                  | Chunks saved.                            |
| `aethercube_entities`                       | `kind`           | Entities by kind.                        |
| `aethercube_plugins`                        | `state`          | Plugins by state.                        |
| `aethercube_plugin_cpu_seconds_total`       | `plugin`, `kind` | CPU time used by a plugin.               |
| `aethercube_plugin_exceptions_total`        | `plugin`         | Exceptions thrown by a plugin.           |
| `aethercube_memory_bytes`                   | `area`           | Memory by area.                          |
| `aethercube_gc_pause_seconds_total`         | `collector`      | Time paused in collection.               |
| `aethercube_gc_collections_total`           | `collector`      | Collections run.                         |
| `aethercube_backend_latency_seconds`        |                  | Latency of backend calls.                |

Good first alerts: `aethercube_tps` below 18, a rising `aethercube_slow_ticks_total`, a growing `aethercube_simulation_queue`, and a steady rise of `aethercube_chunks_unsaved`.

Plugin time is reported separately, which helps find a plugin that slows the tick. The scheduler also logs synchronous plugin tasks that take more than 10 ms. See [Scheduler](https://docs.aethercube.fr/developers/plugins/scheduler.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.aethercube.fr/developers/running-a-server/performance-and-metrics.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.
