# Running many agents on one Mac

> Why many agents slow a Mac down, how to read the load line in crystl status, and safe defaults for builds and workers.

Many agents on one Mac can make every build and test slow. This page explains why, how to read the load line in `crystl status`, and what to do about it.

## Why it gets slow

Builds and tests use every core. One build can keep all your cores busy for minutes. Five agents that build at the same time ask for five times what the Mac has. Each build then takes longer, so the agents wait longer and the pile grows.

More memory does not fix this. A Mac can have plenty of free memory and still be out of CPU time.

## Read the load line

Run `crystl status`. It prints a line like this under the memory line:

```
load: 27.4 on 12 cores · overloaded
```

The first number is the load: how many tasks wanted a core, on average, over the last minute. The second number is how many cores the Mac has. crystl divides the first by the second.

| The line says | Load per core | What it means |
|---|---|---|
| ok | under 0.75 | The Mac has room. |
| busy | 0.75 up to and including 1.25 | Every core is in use. A new worker slows the others. |
| overloaded | over 1.25 | Tasks wait for a core. Everything is slower. |

When the line says overloaded, `crystl status` adds this hint under it: "Wait before you start more workers." `crystl shard create` prints one warning on stderr:

```
Load is 27.4 on 12 cores. A new worker will slow everything down. Wait for the load to drop, or go on.
```

The warning does not stop the new worker, and the exit code does not change. The choice is yours. In the other two states, `crystl shard create` prints no warning.

The load line shows the last minute. After you stop a build, wait a minute and look again.

`crystl status --json` includes the same reading as three fields: `load1` (the one-minute load, with two decimals), `cores`, and `load_state` (`ok`, `busy` or `overloaded`). Use them in a script that decides whether to start more work. If the Mac cannot report its load, the line and the fields are left out.

## Safe defaults

- Run two builds at a time. A third build rarely finishes sooner.
- Give builds half the cores. Most build tools have a setting for this, for example `-j 6` on a 12-core Mac.
- Run only the tests that cover your change. Run the full suite once, before you ship.
- Close worktrees you no longer use. Each worktree keeps its own build folder, so old ones take disk space and slow down searches.
- Start fewer workers when the line says busy or overloaded, or when memory pressure is not normal.

These are starting points. A small project on a fast Mac can run more.

## When the load is high

1. Run `crystl status` and read the load line.
2. Do not start more workers. Let the running ones finish.
3. Find the heavy ones. Open Activity Monitor and sort by CPU, or run `top -o cpu`.
4. If two workers run the same build, ask one to wait.
5. Check again after a minute. Start new work when the line says ok.

Agents that follow the crystl instructions check `crystl status` before they start a third worker. If an agent starts work while the line says overloaded, tell it to wait.

## Go deeper

- [Fanout](/docs/fanout/) for how one manager runs many workers.
- [Isolated shards](/docs/isolated-sessions/) for what each worktree costs.
- [Command line reference](/docs/cli/) for `crystl status` and `crystl shard create`.

---
Source: https://crystl.dev/docs/many-agents/
