Skip to content

Semantic-Aware Auto Scaling

Auto-resize can also react to memory pressure from workloads inside the runtime. The config shape is the same as the vertical scaling example: set resources.memory_mib to the initial 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:

Terminal window
runta apply -f deployment.json
runta ps -a

In one terminal, monitor memory usage inside the runtime:

Terminal window
runta exec -it <runtime_display_name> watch -n 1 free -m

In another terminal, install OpenClaw and run a command that puts pressure on the Node.js heap:

Terminal window
runta exec -it <runtime_display_name> bash
# Install npm through nvm.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
source ~/.bashrc
nvm install --lts
# Increase Node.js' memory limit.
export NODE_OPTIONS="--max-old-space-size=4096"
# Install OpenClaw.
npm i openclaw@2026.3.12 -g
# Even --help can consume enough memory to trigger auto-resize.
openclaw onboard --help

The runtime’s total memory should increase or decrease automatically based on usage. Auto-resize can take a few minutes to scale up or down, depending on the current runtime load.