Resizing
Let your machine grow automatically as your workload needs more resources, or give it more CPU and RAM yourself without stopping it. You can resize a machine in two ways:
- Autoresizing grows the machine's CPU and RAM as demand increases, up to the lower of the limit you set and your plan's limit. We recommend starting here.
- Manual resizing sets a larger CPU and RAM size now.
A machine's size is its CPU and RAM. Resizing a machine down is not currently supported, either manually or automatically. We also don't support resizing filesystem storage.
The examples on this page follow one machine that starts with 2 vCPU and 4 GiB of RAM.
Let a machine grow automatically
Start small and let your machine grow with your workload. Autoresizing adds CPU and RAM as demand increases, up to the limits you choose, without stopping your machine. You no longer have to pick a large machine upfront or resize it by hand each time the workload changes.
RAM grows when the machine runs low on free memory. CPU grows after about 30 seconds of sustained CPU demand. Each step doubles the current size, so our 4 GiB machine grows to 8 GiB, then 16 GiB, until it reaches its cap.
RAM and CPU have separate switches, and both start off. Turning on RAM growth doesn't turn on CPU growth. Here's how you turn on RAM growth up to 16 GiB and keep CPU fixed:
dedalus machines autoresizing update \
--machine-id <machine_id> \
--memory on \
--memory-max-mib 16384 \
--cpu off
settings = client.machines.autoresizing.update(
machine_id="<machine_id>",
memory="on",
memory_max_mib=16384,
cpu="off",
)
const settings = await client.machines.autoresizing.update({
machine_id: "<machine_id>",
memory: "on",
memory_max_mib: 16384,
cpu: "off",
});
settings, err := client.Machines.Autoresizing.Update(ctx, dedalus.MachineAutoresizingUpdateParams{
MachineID: "<machine_id>",
Memory: dedalus.F[string]("on"),
MemoryMaxMib: dedalus.F[int64](16384),
Cpu: dedalus.F[string]("off"),
})
if err != nil {
return err
}
Read the settings back with dedalus machines autoresizing retrieve --machine-id <machine_id>.
The HTTP API reads settings with GET and changes them with PATCH on
/v1/machines/{machine_id}/autoresizing. Fields you leave out keep their current values.
Parameters
machine_idpathstringrequiredThe machine whose growth settings you want to change.
memorybodystringon permits automatic RAM growth. off stops it.
cpubodystringon permits automatic CPU growth. off stops it.
memory_max_mibbodyinteger | nullLargest size RAM may grow to, in MiB. null uses your plan's limit.
cpu_max_vcpubodynumber | nullLargest size CPU may grow to, in steps of 0.25 vCPU. null uses your plan's limit.
Growth limits
Three caps decide how far a machine can grow. Your organization's cap is the limit new machines start with. A limit you set on a machine replaces it for that machine. Your plan's limit applies to every machine, so growth always stops at or below it.
Organization defaults
You can also set default autoresizing limits for all new machines in your organization. These set the upper CPU and RAM caps for automatic growth. Existing machines keep their current settings. Set the defaults with:
dedalus organization autoresizing update --memory on --memory-max-mib 16384 --cpu off
dedalus organization autoresizing retrieve
policy = client.organization.autoresizing.update(
memory="on",
memory_max_mib=16384,
cpu="off",
)
const policy = await client.organization.autoresizing.update({
memory: "on",
memory_max_mib: 16384,
cpu: "off",
});
policy, err := client.Organization.Autoresizing.Update(ctx, dedalus.OrganizationAutoresizingUpdateParams{
Memory: dedalus.F[string]("on"),
MemoryMaxMib: dedalus.F[int64](16384),
Cpu: dedalus.F[string]("off"),
})
if err != nil {
return err
}
The HTTP API uses GET and PATCH on /v1/organization/autoresizing.
Debugging
If your machine does not grow, retrieve it and check blocked_reason under
status.autoresize.memory or status.autoresize.cpu. For MACHINE_GROWTH_LIMIT_REACHED, check
the growth caps and raise the machine's limit if your plan allows it.
Turning growth off
Turning a resource off stops future automatic growth. The machine keeps its current size, and a resize that was already accepted still finishes.
Manually resize a machine
Request more CPU, more RAM, or both at once. The command waits up to 30 seconds for the new size to
take effect, then returns the machine with its confirmed vcpu and memory_mib.
dedalus machines resize --machine-id <machine_id> --vcpu 4 --memory-mib 8192
machine = client.machines.resize(
machine_id="<machine_id>",
vcpu=4,
memory_mib=8192,
)
const machine = await client.machines.resize({
machine_id: "<machine_id>",
vcpu: 4,
memory_mib: 8192,
});
machine, err := client.Machines.Resize(ctx, dedalus.MachineResizeParams{
MachineID: "<machine_id>",
Vcpu: dedalus.F[float64](4),
MemoryMib: dedalus.F[int64](8192),
})
if err != nil {
return err
}
A running machine resizes in place. Its processes keep running and its files stay where they are. A sleeping machine wakes first, then resizes. A machine that is woken remains awake after the resize.
Parameters
machine_idpathstringrequiredThe machine to resize.
vcpubodynumberNew CPU size in virtual CPUs, in steps of 0.25.
memory_mibbodyintegerNew RAM size in mebibytes (MiB). Must be an even number.
Set at least one of vcpu and memory_mib.
Handle a refused resize
A refused resize leaves the machine at its old size. The CLI exits with a non-zero status on a refusal or a timeout, so a script can stop before it does more work.
| Status and code | What it means |
|---|---|
409 MACHINE_RESIZE_UNAVAILABLE | Another resize is in progress for this machine. |
409 ASSIGNED_HOST_CAPACITY_CONFLICT | No capacity for that size now. |
409 MACHINE_NOT_RESIZABLE | The machine failed or is deleting. |
422 MACHINE_TIER_SHAPE_EXCEEDED | The size exceeds your plan. |
503 RESIZE_TIMEOUT | Still resizing after 30 seconds. |
The resize continues after a RESIZE_TIMEOUT. Check its progress with dedalus machines retrieve.
Use autoresizing and manual resizing together
You can use both at the same time. An accepted manual resize takes precedence over a pending automatic one and becomes the machine's new requested size. If autoresizing is on, it can still grow the machine later.
You can also manually resize a machine above its autoresizing limit. It stays at that size until you resize it again, or raise its limit so it can keep growing.
Billing
Billing changes to the new size once the resize is confirmed. See pricing details.
