Articles in this section

How to increase memory allocated to app

The method for increasing memory allocated to an application container differs depending on whether your project is on Upsun Flex or Upsun Fixed.


Upsun Flex

On Flex projects, memory (RAM) is always guaranteed - the full amount you configure is exclusively available to that container.

RAM is determined by your chosen CPU size and the container's container profile (HIGH_CPU, BALANCED, HIGH_MEMORY, or HIGHER_MEMORY). CPU and RAM are linked via the container profile and cannot be set independently.

Via the Console

  1. Open your project in the Upsun Console.
  2. Navigate to the environment you want to adjust.
  3. Click Configure resources.
  4. For your app, select a new CPU & RAM combination from the dropdown.
  5. Click Save. Your environment will redeploy with the new allocation.

Via the CLI

# Interactive mode — follow the prompts
upsun resources:set

# Set CPU for a specific app
upsun resources:set --size myapp:1

# Set CPU for multiple apps at once
upsun resources:set --size frontend:0.5,backend:1

Default container profiles by runtime:

Runtime Default Profile
PHP, Python, Node.js, Ruby, Go, .NET, Rust HIGH_CPU
MariaDB, PostgreSQL, MongoDB, Elasticsearch, Redis persistent HIGH_MEMORY
Redis ephemeral, Memcached BALANCED

For full CPU/RAM combination tables, see Resource configuration.


Upsun Fixed

On Fixed projects, resources are distributed across all containers in the environment based on your plan size. There are two ways to influence memory allocation.

Option 1 - Set the container size

Set a container size in your .platform.app.yaml:

# .platform.app.yaml
size: L

Available sizes: S, M, L, XL, 2XL, 4XL

Memory per size for a PHP app (HIGH_CPU profile):

Size CPU Memory
S 0.40 128 MB
M 0.40 128 MB
L 1.20 256 MB
XL 2.50 384 MB
2XL 5.00 768 MB
4XL 10.00 1536 MB

Note: Increasing the size of one container reduces what is available to others. The total CPU and memory across all containers cannot exceed your plan limit.

Option 2 - Use the resources key for precise memory tuning

For more granular control, use the resources key in your .platform.app.yaml:

# .platform.app.yaml
size: S
resources:
  base_memory: 128   # Base MB of memory (minimum 64, maximum 1024)
  memory_ratio: 180  # Additional MB of memory per vCPU (minimum 128, maximum 1024)

Memory is calculated as: memory = base_memory + (memory_ratio × CPU)

CPU values per size when using resources:

Size CPU
XS 0.25
S 0.50
M 1.00
L 2.00
XL 4.00
2XL 8.00

Example: With size: S, base_memory: 128, and memory_ratio: 180:

  • At size S (0.5 CPU): 128 + (0.5 × 180) = 218 MB
  • At size L (2 CPU): 128 + (2 × 180) = 488 MB

Tips by runtime type:

  • PHP and similar (high memory per request): use a low base_memory and high memory_ratio
  • Java, Go, and persistent runtimes (high startup memory): use a high base_memory and low memory_ratio


 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.