Resource configuration
Choose memory, CPU, and scaling for a deployed DVM.
Most DVMs should start with the generated defaults. Add a dvmkit block to package.json only when the workload or measured production behavior requires something different.
{
"dvmkit": {
"memory_mb": 1024,
"cpu_count": 1,
"cpu_kind": "shared",
"min_machines_running": 0,
"max_machines": 1
}
}
| Field | Range | Meaning |
|---|---|---|
memory_mb | 256–16384 | RAM per machine |
cpu_count | 1–16 | vCPUs per machine |
cpu_kind | shared or performance | Shared or dedicated-performance CPU class |
min_machines_running | 0–100 | Machines kept warm |
max_machines | 1–100 | Maximum concurrent machines |
max_machines must be at least min_machines_running. These ranges are platform safety bounds. Your plan can impose lower limits; a rejected deploy names the requested resource and allowed limit. An unlimited plan has no plan cap but still uses the 100-machine platform ceiling.
Pick memory from the work
- 256 MB: HTTP calls, JSON parsing, small text transforms.
- 512 MB: moderate documents or images and larger response assembly.
- 1024 MB: headless browsers, ffmpeg, yt-dlp, or Python subprocesses.
- 2048 MB and above: large local models, long media, or datasets.
These are starting points. Use dvmctl status and logs to measure the deployed process, then move one tier at a time. An out-of-memory kill calls for more memory or a smaller working set, not more machines.
Keep scaling simple
min_machines_running: 0 allows scale-to-zero. Set it to 1 only when measured cold-start latency is unacceptable and the always-on cost is approved.
Keep max_machines: 1 until concurrent jobs are queueing long enough to matter. More machines increase parallel capacity and the maximum running cost. They do not make one CPU-bound job faster.
Shared CPUs suit services that wait on APIs, storage, or networks. Use performance CPUs only after measurement shows local CPU is the bottleneck.
Examples
A network-bound text service:
{
"dvmkit": {
"memory_mb": 256,
"cpu_kind": "shared",
"min_machines_running": 0,
"max_machines": 1
}
}
A container that runs Chromium or ffmpeg:
{
"dvmkit": {
"memory_mb": 1024,
"cpu_kind": "shared",
"min_machines_running": 0,
"max_machines": 1
}
}
Run dvmctl validate after every configuration change and dvmctl deploy --dry-run before applying it. See deploying for the surrounding identity and payment decisions.