CPU and memory limits
Any service can have a CPU limit and a memory limit: web, worker, cron (each run) and postgres. Without one it may use the whole server, as before.
Setting them
- In
yawl.yaml:cpu: 0.5(cores, at least 0.1) andmemory: 512MB(MBorGB, decimal, at least 64MB). - In the dashboard: a service’s Settings, the CPU and Memory fields. Empty is no limit.
- The plan shows the change, for example
memory none -> 512MB. It takes effect at the next deploy, or a database’s next start.
A CPU limit above the server’s cores fails the deploy: api asks for 8 CPUs; this server has 4.
When an app runs out of memory
Docker stops it at its limit and starts it again at once. The memory limit is also the swap limit, so an app at its limit restarts instead of slowing down. You get one Telegram message and an incident:
acme/production/api ran out of its 512 MB memory limit and was restarted.- after an hour without another:
acme/production/api has not run out of memory for an hour.
A crash loop is one incident, not a message a minute.
Adding up
When the memory limits on one server would add up to more than its memory, the plan says so and still applies:
warn server hel1 memory limits add up to 10.0 GB; it has 7.8 GB
Services without a limit do not count. The server’s memory is known once its agent has sent one minute of metrics.
On the graphs
A service’s Metrics tab draws its limits as a dashed line on CPU (in percent of one core, so 0.5 is 50%) and Memory.
Not limited
Builds, disk and network bandwidth.