Set resources
You can define how much CPU, memory, and disk you want to assign to each of your service and app containers.
If you don’t explicitly set resources, Upsun uses default resources instead. Upsun also offers several resource initialization strategies to help you allocate resources depending on your needs and use cases. However, for the sake of this guide, let’s set resources manually. To do so, follow these steps:
-
Run the following command:
Terminalupsun resources:set
This launches an interactive prompt to walk you through setting up your application’s resources:
Terminalupsun resources:set Resource configuration for the project app (123456azerty), environment main (type: production): +-----------------------+---------+---------+-------------+-----------+-----------+ | App or service | Size | CPU | Memory (MB) | Disk (MB) | Instances | +-----------------------+---------+---------+-------------+-----------+-----------+ | myapp | 1 | 1 | 384 | N/A | 1 | | [<additional-service>]| 0.1 | 0.1 | 128 | N/A | 1 | +-----------------------+---------+---------+-------------+-----------+-----------+
-
Select the profile size you want applied to your application image. For instance,
0.1
:TerminalApp: myapp Choose a profile size: [0.1 ] CPU 0.1, memory 64 MB [0.25] CPU 0.25, memory 128 MB [0.5 ] CPU 0.5, memory 224 MB [1 ] CPU 1, memory 384 MB [2 ] CPU 2, memory 704 MB [4 ] CPU 4, memory 1216 MB [6 ] CPU 6, memory 1728 MB [8 ] CPU 8, memory 2240 MB [10 ] CPU 10, memory 2688 MB > 0.1
-
Define how many instances of your application container you want to deploy. For instance,
1
:TerminalEnter the number of instances (default: 1): 1
-
To confirm your choices, select
Y
.Upsun grabs the previous built images from earlier, applies your resource selections to them, and deploys your full application!
Note
If the deployment fails, you may need to set the resources again.