Sizes and the base image
Pick a box size, resize later, and move a box onto a newer base image.
Sizes
kvbox new takes --size (-s): a preset the server defines, s by default (2 vCPU, 4 GB of RAM, 8 GB of disk); xs is 1 vCPU and 2 GB for a small site, m and l double from s. kvbox deploy makes an xs box. A box can be resized later:
kvbox vm rescale <box> --vcpu 4 --mem 16GB --disk 32GB
kvbox vm rescale <box> --size mDisk only grows. A running box restarts to take the new size.
To see whether a box fits its size, ask it how it is doing:
kvbox vm topOne line per running box: its load over 1 and 5 minutes (out of its vCPU count), memory and disk in use, and uptime, as the box sees them. Memory in use leaves out the page cache. --json gives the same numbers for scripts. A box on a base image older than v0.7.0 shows dashes until kvbox vm update moves it onto a newer one.
Swap for memory spikes
A small box often needs more memory only for a minute: npm install or next build on an xs box can run out of its 2 GB and get killed. Rather than paying for a bigger size all the time, give the box swap:
kvbox vm set <box> --swap 2G
kvbox vm set <box> --swap offIt is a swap file on the box's own disk (/rom/overlay/swapfile), kept across reboots, clones and snapshots. Swap is far slower than RAM, so the box also gets zswap (pages are compressed in memory before they reach the file) and a low swappiness: it is there for spikes, not for a box that needs more RAM all the time; for that, rescale. Off by default because the file takes space on the box's disk (2 GB of an 8 GB xs disk), and on the host once the box has swapped; a size that would leave the disk under 1 GB free is refused. A hibernated or paused box is woken for it; a stopped one must be started first.
The host keeps a capacity guard: a box that would not fit in free RAM is refused, whether it is new, started, woken from hibernation, or a running box rescaled to a bigger shape. --force skips it. Through a control plane, kvbox new is placed on the joined host with the most free RAM.
The base image
Every box boots from a shared base image (built from kvbox-images): Linux with SSH, a user for you, and kvbox-agent. Per-box settings (hostname, SSH key, IP) arrive on the kernel command line at boot, so one image serves every host and user. On the host, kvbox-server status shows which image new boxes get.
When a host gets a newer base image, an existing box keeps the old one until you move it:
kvbox vm update <box>Its files stay; a running box restarts.