Resource limits
OwnStack exposes Dokku's per-process-type resource limits in the dashboard and CLI. Set a memory cap on worker, web, or any other Procfile type, and a runaway container is killed by Docker before it can take down the whole host.
Without a per-container memory limit, a leaking Ruby worker can consume every byte the host has, trigger a system-wide kernel OOM kill, and leave the host hung. With a 2 GB cap, the same leak gets killed at 2 GB and the container restarts. The other apps on the box keep running.
Set a cap
From the dashboard, open the app and scroll to Resource limits on the stack overview tab. Each Procfile process type has a row showing the current memory limit (or — if unset). Enter a size, optionally tick restart after, hit Set.
Or from the CLI:
$ ownstack app limit <app>
PROCESS MEMORY CPU
default - -
web 512m -
worker - -
$ ownstack app limit <app> --process-type=worker --memory=2g --restart
Set worker memory=2g
Restart triggered for worker.
What memory size to pick
| Process type | Common range | Notes |
|---|---|---|
web (Rails) | 256–768 MB | Puma worker count × per-worker RSS. Match your usual production sizing. |
worker (Sidekiq) | 512 MB – 2 GB | Sidekiq concurrency × job memory. If jobs handle large records, 2 GB is realistic. |
release | 512 MB – 1 GB | Just enough to run rails db:migrate etc. |
default | — | Sets the cap for any process type without its own row. |
Pick the smallest cap that doesn't kill legitimate work. If a process gets OOM'd inside its limit, that's the signal to either raise the cap or fix the leak (often the better answer).
Clear a cap
$ ownstack app limit <app> --process-type=worker --clear
Or hit Clear on the row in the dashboard.
How it applies
The limit is a Dokku resource limit, which becomes a Docker --memory flag on the container at next start. Until you restart the container, the cap is configured but not active — that's what the restart after option (or --restart on the CLI) takes care of.
Read next
- Stack monitoring — host-level alerting so you find out before the user does.
- Procfile — defining process types in the first place.
- CLI: ownstack app