# System

The System page shows what CrushBalance is running on and how it is doing, lists problems in the configuration, and restores backups.

![The System page](System/system.png)

## The cards

| Card | Shows |
|---|---|
| **Runtime** | the version and build, the host name, the uptime, Java (version and folder), the operating system and its memory and load, the process (id, user, CPU, open files out of the limit), the working directory, the prefs directory, the log file, and the Java options it was started with |
| **Engine** | the internals that matter for capacity: worker counts, the buffer budget and what is in use, the global connection cap, and the number of sticky entries |
| **Threads** | live, daemon and peak thread counts |
| **GeoIP** | on or off, cached locations, lookups per minute, this month's count |
| **Memory and CPU** | charts of the heap in use, the heap limit and direct buffers, and of the CPU, over 10 minutes or 24 hours |
| **Certificates** | the admin certificate and each listener's certificate: subject, expiry, fingerprint, and a warning when one expires within 30 days. A listener's row opens its TLS tab. |
| **Configuration** | the `prefs.XML` in use: its path, size, when it changed, and the state of the key file `crushbalance.key` |
| **Issues** | every problem CrushBalance found in the configuration, grouped by severity, each with a link to the field. Errors stop the part they are in (for example one listener); warnings do not. |
| **Windows service** | whether CrushBalance runs as a Windows service, and the commands to install and remove it, to copy. The page itself never installs or removes the service ([Install on Windows](Install-Windows.md)). |
| **Backups** | the saved versions of the configuration, see below |

Open files matter: every session uses two. When "Open files" gets close to its limit, raise the limit ([Capacity and tuning](Capacity-and-Tuning.md)).

## Backups and restore

Every change to `prefs.XML`, by a save on the admin page or by a hand edit, keeps a copy of the new version in the `backup` folder. The newest 50 are kept, so the newest backup is always the current configuration.

**Restore** next to a backup puts that version back, after a confirmation. The current admin password, the metrics token and the registration are kept, and the version you replaced stays in the list.

## Hand edits

You can edit `prefs.XML` in a text editor while CrushBalance runs. It picks the change up within about 2 seconds and applies it the same way as a save. A file it cannot read is never used and never overwritten: the running configuration stays, and a banner says what is wrong.

To check a file before you rely on it:

```
java -jar CrushBalance.jar -check-config
```

## Safe mode

If `prefs.XML` is damaged when CrushBalance starts, it starts in **safe mode**: no listener is open, and the admin page shows only what is wrong and the backups to restore. Restore one, or fix the file by hand; [Troubleshooting](Troubleshooting.md) has the steps.
