Skip to content

Vertical Scaling

Set resources.memory_mib to the initial memory allocation and auto_resize.memory_max_mib to the maximum memory that the runtime can grow to.

Terminal window
cat > deployment.json <<EOF
{
"apiVersion": "runta/v1",
"kind": "SandboxSet",
"sandboxes": [
{
"name": "<runtime_display_name>",
"resources": {
"vcpus": 1,
"memory_mib": 512
},
"auto_resize": {
"memory_max_mib": 16384
}
}
]
}
EOF

Deploy the runtime and check its initial memory:

Terminal window
runta apply -f deployment.json
runta ps -a
runta exec <runtime_display_name> free -m

Resize the runtime to 4096 MiB, then verify the new allocation:

Terminal window
runta resize <runtime_display_name> --memory 4096
runta exec <runtime_display_name> free -m

Resize it back to 512 MiB and verify again:

Terminal window
runta resize <runtime_display_name> --memory 512
runta exec <runtime_display_name> free -m

Clean up:

Terminal window
runta delete -f deployment.json