Default resources
Upsun allocates the following default resources to every container when deployed for the first time:| Resource type | Amount |
|---|---|
| CPU | 0.5 |
| RAM | Depends on the container profile. |
| Disk size (only applicable if the app or service requires a disk) | 512 MB |
For information on costs related to resource usage, see the Upsun pricing page.
You can monitor these costs in the Console.
Specify a resource initialization strategy
Upsun provides the following resource initialization strategies:| Strategy | Description |
|---|---|
default | Initializes new containers using the Upsun default resources. This strategy applies when you first deploy your project (or new container) unless you explicitly specify a different strategy, or allocate resources manually via the resources:set CLI command. |
manual | With this strategy, the first deployment fails and you need to configure resources manually through the Console, or using resources:set in the CLI.This strategy allows you to set the exact resources you want, with a single deployment. Other strategies may require fine-tuning, and therefore generate a second deployment. In this case, your environment would run for a short time with unwanted resources, and both deployments would generate downtime. |
minimum | Initializes new containers using the Upsun minimum resources (see below). |
parent | Initializes new containers using the same resources as on the parent environment. If there is no parent environment, or if the container doesn’t already exist on the parent, the default strategy applies instead. |
child | Initializes new containers using the same resources as on the child environment. Only relevant during merge activities. |
backup | When restoring a backup, initializes new containers using the same resources as when the backup was taken. |
More information on…
| Action | Available strategies | Default |
|---|---|---|
| First deployment | parent, default, minimum, manual | parent |
| Environment branch | parent, default, minimum | parent |
| Environment merge | child, default, minimum, manual | child |
| Environment activation | parent, default, minimum | parent |
| Backup restoration | backup, parent, default, minimum | backup |
First deployment
Resource initialization strategies
Available:parent, default, minimum, manual Default:
parent- Without a source integration
- With a source integration
If you’re not using a source integration,
you can use a Git push option to specify a resource initialization strategy.
To do so, run the following command:For example, to use the Note that you can specify a different resource initialization strategy for each of your deployments.
Terminal
minimum strategy for your deployment, run the following command:Terminal
Alternatively, you can use the official Git syntax for push options:
Terminal
Environment branch
Resource initialization strategies
Available:parent, default, minimum Default:
default if the new environment is of type staging, minimum if the new environment is of type developmentWhen you branch an environment, regardless of the strategy you specified,
Upsun checks if the child environment’s disk size is at least equivalent to the parent’s.
If not, the parent environment’s disk size is automatically applied to the child environment. This ensures the branching can succeed.
If not, the parent environment’s disk size is automatically applied to the child environment. This ensures the branching can succeed.
- Using the CLI
- In the Console
Run the following command:For example, to use the
Terminal
parent resource initialization strategy, run the following command:Terminal
Environment merge
Resource initialization strategies
Available:child, default, minimum, manual Default:
childAny other container already running on the parent environment keeps its resources.
- Using the CLI
- In the Console
Run the following command:For example, to use the
Terminal
manual resource initialization strategy, run the following command:Terminal
Environment activation
Resource initialization strategies
Available:parent, default, minimum Default:
default if the new environment is of type staging, minimum if the new environment is of type developmentTerminal
parent resource initialization strategy, run the following command:
Terminal
Setting resources on a inactive environment using the Console or the CLI automatically activates it.
Backup restoration
Resource initialization strategies
Available:backup, parent, default, minimum Default:
backup- Using the CLI
- In the Console
When you restore a backup using the CLI,
you can restore it to your current environment or a different environment.If you deleted containers after backing up but before restoring, they are recreated using the When you restore previously deleted containers,
you can specify a different resource initialization strategy for them.For example, to use the
Backup restoration to your current environment
By default, when you restore a backup using the CLI, it is restored to your current environment. The resources of every container already running on the environment are reverted to their original state when the backup was taken.If you don’t want to restore the resources from when the backup was taken,
opt out of restoring the resources.
To do so, when you restore your backup, use the
--no-resources option.backup strategy.
Meaning, they are granted the same resources as in the backup.If you don’t want to restore previously deleted containers,
opt out of restoring the code.
To do so, when you restore your backup, use the
--no-code option.Backup restoration to a different environment
Thebackup strategy also applies by default.
All apps and services are initialized as new containers on the environment,
and granted the same resources as in the backup.
Note that you can specify a different resource initialization strategy for all of them.Specify a resource initialization strategy when restoring a backup via the CLI
Run the following command:Terminal
minimum resource initialization strategy, run the following command:Terminal
Environment sync
Syncing an environment means merging changes from a parent environment into a child environment. You can sync:- Only the code
- Only the data (databases, files)
- Only the resources (CPU and RAM, instances, and disk space)
- Any combination of the three (code and data, data and resources, etc.)
When you sync the data, Upsun checks if the child environment’s disk size is at least equivalent to the parent’s.
If not, the parent environment’s disk size is automatically applied to the child environment. This ensures the sync can succeed.
If not, the parent environment’s disk size is automatically applied to the child environment. This ensures the sync can succeed.
- Using the CLI
- In the Console
Run the following commands depending on your needs:
-
Sync only resources:
Terminal
-
Sync only code:
Terminal
-
Sync only data:
Terminal
-
Sync everything:
You can adjust the command depending on the exact combination of elements you want to sync.Terminal