Resource initialization
Back to home
On this page
When you first deploy your project or add a new container to it, Upsun uses default resources unless you specify a resource initialization strategy.
You can also use a specific resource initialization strategy when performing certain actions, such as branching, merging, and activating an environment, or restoring a backup.
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 |
If you don’t want to use these default resources, you can specify a resource initialization strategy. You can also adjust resources after your project or new container has been deployed.
Note
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…
The following table shows the resources Upsun allocates to your containers when you opt for the * The disk size is set to Upsun minimum resources
minimum
resource initialization strategy.
Container
CPU
RAM
Disk*
.NET core
0.1
64 MB
0 MB
Chrome Headless
0.1
64 MB
None
Elasticsearch
0.1
448 MB
256 MB
Elasticsearch Premium
0.1
448 MB
256 MB
Elixir
0.1
64 MB
0 MB
Go
0.1
64 MB
0 MB
InfluxDB
0.1
448 MB
256 MB
Java
0.1
448 MB
0 MB
Kafka
0.1
448 MB
512 MB
Lisp
0.1
64 MB
0 MB
MariaDB
0.1
448 MB
256 MB
Memcached
0.1
352 MB
None
MongoDB
0.1
448 MB
256 MB
MongoDB Premium
0.1
448 MB
256 MB
Network Storage
0.1
448 MB
256 MB
Node.js
0.1
64 MB
0 MB
OpenSearch
0.1
448 MB
256 MB
Oracle MySQL
0.1
448 MB
256 MB
PHP
0.1
64 MB
0 MB
PostgreSQL
0.1
448 MB
256 MB
Python
0.1
64 MB
0 MB
RabbitMQ
0.1
448 MB
256 MB
Redis ephemeral
0.1
352 MB
None
Redis persistent
0.1
352 MB
256 MB
Ruby
0.1
64 MB
0 MB
Rust
0.1
64 MB
0 MB
Solr
0.1
448 MB
256 MB
Varnish
0.1
448 MB
None
Vault KMS
0.1
448 MB
256 MB
None
when the container never uses disk, and to 0 MB
when the container doesn’t require disk but can use it.
You can specify a resource initialization strategy when performing the following actions:
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
You can define which resource initialization strategy Upsun uses to allocate resources when you first deploy your project or add a new container.
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:
upsun push --resources-init=INITIALIZATION_STRATEGY
For example, to use the minimum
strategy for your deployment, run the following command:
upsun push --resources-init=minimum
Note
Alternatively, you can use the official Git syntax for push options:
git push upsun -o resources.init=minimum
Note that you can specify a different resource initialization strategy for each of your deployments.
If you’re using a source integration,
you can use the --resources-init
flag to specify a resource initialization strategy.
Note
Once a resource initialization strategy is specified for your source integration, it applies to all the deployments you launch through that source integration.
To specify a resource initialization strategy when creating your source integration,
include the --resources-init
flag in your source integration options.
For example, if you set up a GitHub integration, use the following options:
platform integration:add \
--project PROJECT_ID \
--type github \
--repository OWNER/REPOSITORY \
--token GITHUB_ACCESS_TOKEN \
--base-url GITHUB_URL
--resources-init INITIALIZATION_STRATEGY
To specify a resource initialization strategy for an existing source integration, run the following command:
upsun integration:update --resources-init=INITIALIZATION_STRATEGY
For example, to use the minimum
strategy for your deployment, run the the following command:
upsun integration:update --resources-init=minimum
Environment branch
Resource initialization strategies
Available: parent
, default
, minimum
Default: parent
By default, when you branch an environment to create a new child environment, the child environment inherits all the resources from its parent. However, you can specify a different resource initialization strategy.
Note
When 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.
Run the following command:
upsun environment:branch --resources-init=INITIALIZATION_STRATEGY
For example, to use the minimum
resource initialization strategy, run the following command:
upsun environment:branch --resources-init=minimum
- Navigate to the environment you want to branch from.
- Click Branch.
- Enter a name and a type for the new environment.
- Select an initialization strategy from the proposed list.
- Click Branch.
Environment merge
Resource initialization strategies
Available: child
, default
, minimum
, manual
Default: child
When you merge a child environment into its parent environment, any apps and services you created on the child are merged and therefore created on the parent.
When this happens, any new app or service container created on the parent environment is granted the same resources as on the child environment. However, you can specify a different resource initialization strategy.
Note
Any other container already running on the parent environment keeps its resources.
Run the following command:
upsun environment:merge --resources-init=INITIALIZATION_STRATEGY
For example, to use the manual
resource initialization strategy, run the following command:
upsun environment:merge --resources-init=manual
- Navigate to the environment you want to merge into its parent.
- Click Merge.
- Select an initialization strategy from the proposed list.
Note
The list of strategies is only displayed if a new app or service is included in the merge.
- Click Merge.
Environment activation
Resource initialization strategies
Available: parent
, default
, minimum
Default: parent
When you activate an environment, Upsun uses the same resource allocation as on the parent environment.
If there is no parent environment, the default
resource initialization strategy applies.
You can also specify a different resource initialization strategy using the CLI. To do so, run the following command:
upsun environment:activate --resources-init=INITIALIZATION_STRATEGY
For example, to use the minimum
resource initialization strategy, run the following command:
upsun environment:activate --resources-init=minimum
Note
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
When you restore a backup using the CLI, you can restore it to your current environment or a different environment.
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.
Note
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.
If you deleted containers after backing up but before restoring, they are recreated using the backup
strategy.
Meaning, they are granted the same resources as in the backup.
Note
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.
When you restore previously deleted containers, you can specify a different resource initialization strategy for them.
Backup restoration to a different environment
The backup
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:
upsun backup:restore --resources-init=INITIALIZATION_STRATEGY
For example, to use the minimum
resource initialization strategy, run the following command:
upsun backup:restore --resources-init=minimum
When you restore a backup using the Console, 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.
Note
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.
If you deleted containers after backing up but before restoring, they are recreated using the backup
strategy.
Meaning, they are granted the same resources as in the backup.
Note
If you don’t want to restore previously deleted containers,
opt out of restoring the code.
To do so, restore the backup using the CLI, and use the --no-code
option.
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.)
Note
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.
Run the following commands depending on your needs:
-
Sync only resources:
Terminalupsun sync resources
-
Sync only code:
Terminalupsun sync code
-
Sync only data:
Terminalupsun sync data
-
Sync everything:
Terminalupsun sync code data resources
You can adjust the command depending on the exact combination of elements you want to sync.
- Navigate to your Production environment.
- Click Sync.
- Select the sync options you want from the proposed list.
- Select Sync resources from Production into Staging.
- Click Sync.