Running apps
Processes & scaling
Run more instances, bigger instances, and more kinds of process, with zero-downtime rollouts.
Scale out and up#
Each instance is its own Firecracker microVM. On a cluster, instances are spread across your servers. ps:scale with no counts shows the current scale.
Process types#
To run more than one kind of process, add a Procfile to your repo:
Only web runs at first. Scale the others to start them:
Only web gets HTTP traffic. For a Procfile somewhere else: jokku builder:set myapp procfile Procfile.prod.
Instance sizes#
Each instance starts with 1 vCPU and 256 MiB of memory. Set sizes per process type:
Memory takes 512, 512m or 1g; plain numbers are megabytes. In a microVM, the limit is also the reservation: memory is never overcommitted, so an instance only starts on a server with that much free. vCPUs may be shared.
Start, stop and restart#
Crashed instances restart on their own. The policy is on-failure:10 by default:
Zero-downtime deploys#
Every deploy, scale or settings change rolls out the same way:
- Jokku boots the new release's instances to the target scale.
- It waits for them to pass checks: the process stays up and, for
web, accepts TCP connections on$PORT. - It switches traffic to the new instances.
- After the
wait-to-retireperiod, 60 seconds by default, it stops the old ones.
If checks fail, the deploy fails, the new instances are torn down, the old release keeps serving, and you see the failing instance's output.
Only what changes restarts. A process type the new release would run exactly as before (same image, command, environment, port, size and volumes) is left running. Scaling worker leaves web alone, and the deploy says so:
Releases#
Each deploy and config change creates a numbered, immutable release: the build, process types, config vars and sizes.
releases:rollback is planned.