Use this when judging whether nested virtualization is fast enough for a lab or CI workload.
Performance Impact
Nested virtualization adds overhead because every VM exit in the L2 guest is handled by both hypervisor levels. CPU-heavy work runs reasonably, but I/O and frequent exits are much slower, so keep it for labs and testing.
1. Nested adds VM exits and overhead — slower CPU, much slower I/O.
2. Use PV drivers at every level.
3. Give L1 enough vCPUs and memory.
4. Avoid for performance testing.
5. Use for function tests.
L2 operation → L1 exit → L0 handles
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Measuring Verify boundary
Run the same benchmark (e.g. fio, sysbench) in an L1 VM and in an L2 VM on the same host to see the real overhead for your workload.
Step 2 Common mistakes Narrow the fault
- Using nested setups for performance testing.
- Running production workloads nested.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- CPU work OK, I/O and exits slow.
- Don't benchmark production on nested.
- Paravirtual drivers help.
time <workload> in L2 vs L1— comparevmstat 1— L1 stealperf kvm stat— VM exits (L0)
ReferenceWhy it matters1 section · depth on demand
Typical impact
CPU-bound workloads often run at 80–95 % of L1 speed; I/O- and syscall-heavy workloads can be much slower. Measure your own workload.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Performance of nested setups: CPU-bound L2 code runs close to native thanks to hardware assists, but every L2 exit (I/O, interrupts, page faults) traps to L0, which emulates it for L1, which handles it for L2 — so I/O-heavy and memory-intensive L2 workloads can run several times slower.
Improvements: paravirtual devices at both levels, static memory, host CPU model, large pages, avoiding overcommit on L0, and fast storage. Measure, and do not use nested numbers to size production.
Where overhead comes from
- Every L2 VM exit is handled by L0 and often reflected to L1.
- Two levels of memory translation (shadow EPT).
- Emulated devices are slower twice over.
Expect noticeably lower I/O and syscall-heavy performance; CPU-bound work is usually closer to native.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Nested Virtualization → Performance Impact. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%