Proposal: Template memory hotset profiling & prewarm for faster starts #1848
youhangwang
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Templates can ship a small "startup hot set" profile; at restore time the VMM pre-reads exactly those regions into the page cache. First-touch faults hit memory instead of disk, cutting cold-start latency. Default off (CUBE_TEMPLATE_PROFILE_ENABLE), pure optimization, degrades to current behavior on any failure.
Problem
fast-restore MAP_PRIVATE-maps the template memory file into the VMM, so every guest first-touch fault is a real disk read. On a cold node (reboot, memory reclaim) NVMe I/O dominates startup latency. One structural fact makes this very fixable: all sandboxes from a template map the same shared inode, so warming its hot set once benefits every sandbox on the node.
Proposal
Safety
No valid profile → restore path is byte-for-byte unchanged. Stale profiles are deleted unconditionally on rebuild. Profiling and prewarm failures only log; they never block a template release or sandbox create.
All reactions