Set the limits of a service
The limits of a service apply to each instance and to each job run.
$ ferry update api --memory 2GUpdated 'api'Resource limits apply to the next deploy or restart: ferry restart api$ ferry restart api --followEach instance of the service gets the limits. Each job run gets them too, one-off or on a schedule.
A new limit applies at the next deploy or restart. See When a new limit applies.
Choose your tool
ferry create, ferry update and ferry up accept --memory and --cpu.
ferry create api --repo https://github.com/you/api --memory 1G --cpu 0.5
ferry update api --memory 2G # change it
ferry update api --cpu default # back to the server default
ferry up --memory 768M # ferry up takes them toodefault (or 0) means the server default. ferry show prints the limits of the service.
Memory limit: 2 GiB
CPU limit: server default (1 CPU)The range
| Limit | Smallest | Largest |
|---|---|---|
| Memory | 16 MiB | 1 TiB |
| CPU | 0.01 CPU | 512 CPUs |
Each limit is a menu with three types of choices:
- Server default, with the value of the server.
- Fixed values: from 256 MiB to 8 GiB of memory, or from 0.25 to 4 CPUs.
- Custom…, to type a size such as
768Mor1500m.
The dashboard disables the CPU values above the CPUs of the Docker host. It puts a mark on the memory values above the memory of the host.
After a save, the dashboard offers Restart now if the service is live. The restart gives the new limits to the instances.
POST /api/v1/services accepts the same fields: memory_limit_mb and cpu_limit.