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. The declarative config schema currently uses SandboxSet and sandboxes. Each entry in sandboxes creates or updates one runtime.

Terminal window
cat > deployment.json <<EOF
{
"apiVersion": "runta/v1",
"kind": "SandboxSet",
"sandboxes": [
{
"name": "demo",
"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 demo free -m

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

Terminal window
runta resize demo --memory 4096
runta exec demo free -m

Resize it back to 512 MiB and verify again:

Terminal window
runta resize demo --memory 512
runta exec demo free -m

Clean up:

Terminal window
runta delete -f deployment.json