GuidesProduction setup
Choose the default limits
Change the default limits when your server has one CPU, little memory or special needs.
FERRY_DEFAULT_MEMORY_LIMIT=256M
FERRY_DEFAULT_CPU_LIMIT=0.5The defaults are good for a small server with some apps. Change them when your server is different.
Which values to choose
| Your server | Change |
|---|---|
| One CPU | The default CPU limit is the full host. Lower --default-cpu-limit, for example to 0.5. Then one busy app cannot take the CPU from the others. |
| Little memory, many small apps | Lower --default-memory-limit, for example to 256M. Give more to the services that need it. |
| No default limits | Set --default-memory-limit 0 and --default-cpu-limit 0. Then a container has no limit unless its service or datastore sets one. A 0 turns the guard off, and the protection with it. |
Set the values
Add the values
Add the flags to ExecStart in the unit file. As an alternative, add their variables to /etc/ferry/ferryd.env.
Restart ferryd
sudo systemctl restart ferrydThe new defaults apply to the containers that Ferry creates from then on.
- New containers get them: deploys, restarts, instances that the reconciler replaces, job runs and new datastores.
- The containers that run keep their limits until Ferry replaces them.
ferry restart NAMEreplaces the instances of a service without a build.ferry db update NAME --memory defaultapplies the new defaults to a datastore that sets no limits of its own.
ferryd refuses to start on a value that it cannot use. The error gives the name of the flag.
If a default is more than the host has, ferryd writes a warning: --default-cpu-limit 4 is more than the Docker host's 2 CPUs; containers get at most 2.
ferryd reads the CPUs and the memory of the host one time, at its start. Restart ferryd after a resize.