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.

Why this exists.

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 typeCommon rangeNotes
web (Rails)256–768 MBPuma worker count × per-worker RSS. Match your usual production sizing.
worker (Sidekiq)512 MB – 2 GBSidekiq concurrency × job memory. If jobs handle large records, 2 GB is realistic.
release512 MB – 1 GBJust enough to run rails db:migrate etc.
defaultSets 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.