Set environment limits and networking
Decide what a managed Project's environment may use, and how it reaches the network.
Before you start
Only administrators change instance defaults and a Project's resource limits. Managing an environment also needs access to the managed Project.
Set defaults for new environments
- Open Settings → Plugins → Environments.
- Find Environment defaults and change a value.
- Save the plugin settings. Chetty saves the change and restarts, and the screen says so.
| Setting | Config key | Default | Range |
|---|---|---|---|
| Confine non-operator commands | confineNonOperators |
On | On or off |
| Processor | defaultCpus |
1 CPU | 0.1–64 CPU |
| Memory | defaultMemoryMb |
1,024 MiB | 128–65,536 MiB |
| Swap | defaultSwapMb |
0 MiB | 0–4,096 MiB |
| Process and thread limit | defaultPidsLimit |
512 | 32–8,192 |
| Disk speed | defaultIoMbPerSec |
150 MB/s | 5–4,000 MB/s |
| Network speed | defaultNetMbitPerSec |
Unlimited | 0–10,000 Mb/s |
| Default network mode | defaultNetworkMode |
Shared outbound network | Shared or isolated |
These defaults apply when an environment is first provisioned. An existing environment keeps its own limits and network mode.
Change one Project's resources
- Open the managed Project and choose Environments.
- Use the Limits block for processor, memory, swap, the process and thread limit, disk, disk speed and network speed. The block is always open.
- Changes save themselves. A change on a running environment applies without a restart.
Before the first start, a resource change is saved without creating a machine, and the first start uses the edited limits. Invalid limits are refused before an operation is queued. Chetty can apply the same values through its Project tool's resources action.
The process and thread limit counts both processes and threads. Changing the network mode briefly stops and restores the environment.
Disk space
A Project's disk ceiling is set per Project, not in the defaults. If an environment has no ceiling of its own, the built-in ceilings apply: zero swap, 150 MB/s of disk speed and 10 GiB of disk space.
- A ceiling is at least 1,024 MiB and at most the capacity of the volume that holds the environment's disk. The default is 10 GiB.
- Usage above the ceiling stops the environment. Free space or raise the ceiling before starting it again.
- Alerts in the bell warn at 80% of the ceiling, report when usage passes it, and clear below 75% of it.
- The sandbox data directory must be on a disk or partition the host can account for.
Disk speed
Every environment is held to a disk speed ceiling, one figure for reading and one for writing, so one environment that copies or builds heavily cannot make the host's other services wait for the disk.
One MB is 10^6 bytes, the way disk makers count, and the default of 150 MB/s is about what a 7200 rpm hard disk sustains.
Set it per Project on the Environments page or with the Project tool's resources action (ioMbPerSec). The slowest ceiling accepted is 5 MB/s, by the slider (which moves in steps of 5), the plugin default, the Project tool and the privileged helper alike; a lower figure is refused.
Swap
Environments are kept out of the host's swap. The swap limit is the amount of host swap an environment may use beyond its memory limit, and it is zero by default: an environment that reaches its memory limit has processes stopped inside it instead of pushing pages onto the host's disk.
Administrators change it per Project on the Environments page, in the row above disk speed, or with the Project tool's resources action (swapMb, in MiB).
Network mode and speed
| Mode | What it allows |
|---|---|
| Shared outbound network | Outbound internet through a private machine link. |
| Isolated loopback only | Only the environment's own loopback traffic. |
Set Network speed on the Project's Environments page or with the Project tool's resources action.
- Zero means unlimited.
- A positive limit applies separately to download and upload, without restarting the environment.
- The tool accepts whole numbers up to 100,000 Mb/s; the slider offers up to 10,000.
- An isolated environment keeps the setting for later shared networking.
Forward a port
- Open the Project's Environments page and find Networking.
- Select Add port and choose the protocol, the host port and the environment port.
- Check that the host port is not exposed on the host's loopback interface.
Inbound forwarding supports TCP or UDP, with host and environment ports from 1 to 65,535. Only instance administrators may change the network policy, including ports below 1,024 such as UDP 500 for IKEv2. Every environment start refuses ports already used by a host listener for that protocol; if availability cannot be checked, it does not start. Free the port or choose another one. Saving a stopped environment does not reserve the port against host services.
Watch resource use
The Resources block at the top of a Project's Overview shows what its environment is using right now, with the same five rings a Project card draws: CPU, RAM, disk space, disk speed and network.
- Each ring opens that metric's history, and the CPU ring names the processor model.
- A block whose figures could not be refreshed says they are the last known ones.
- A stopped environment keeps its rings and writes Stopped in them, and a host Project has no such block.
- Network shows the busier of download and upload in decimal Mb/s, with both directions in its tooltip. Unlimited networking has a measured value without a percentage arc, and isolated environments have no external traffic.
- The disk-speed ring shows the busier direction against its ceiling, with both directions in its tooltip.
- History includes Network on its right axis and is also available from a Project's card.
If a limit is refused
- A disk speed below 5 MB/s is refused: that is the slowest accepted ceiling everywhere. Raise it.
- A disk ceiling that is too large is refused: it cannot exceed the capacity of the volume that holds the environment's disk.
- The environment will not start: read the disk alert, free space or raise the ceiling, then start it again.
- A change vanished: check the background operation; a request that is still running is not a finished change.
Related guides
Continue with Environments overview, Start, stop and snapshot an environment, Prepare a host or Projects overview.