Skip to content

Golden template

Freeze once. Instantiate N.

A golden is an artifact of an image, not of a machine. N copies restore from the same file and the kernel shares its pages.

Terminal window
kling save plantilla golden
kling run -from golden -name g1
kling template

Output

golden golden snapshot (80M of memory)
instantiate with: kling run -from golden
a3f9... g1 instantiated from golden in 34 ms
NAME IMAGE CPU/MEM MEMORY DISK INSTANCES AGE
golden default 1/256MiB 80M 80M 10 21s
10 from a golden 10 cold
Added RAM +68 MiB +824 MiB
Per machine 6.8 MiB 82 MiB
Time per machine ~40 ms ~2.6 s

On a 4 GB host: 142 microVMs in 3.9 GB, and an explained refusal at number 143 instead of an OOM.

kling save waits for the guest to answer before freezing (-wait, 60 s). A golden taken too early restores in 26 ms and then never answers.

By default it freezes with a warm child process: the golden does not pay the runtime’s startup (300-500 ms of node). -warm=false trades latency for disk.