mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 05:12:04 +00:00
[PR #87] [MERGED] perf(launch): cut fixed costs from the container create/start hot path #87
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/87
Author: @JBailes
Created: 6/16/2026
Status: ✅ Merged
Merged: 6/16/2026
Merged by: @JBailes
Base:
fix/gc-reaps-creating-container← Head:perf/launch-fast-paths📝 Commits (1)
bfee100perf(launch): cut fixed costs from the container create/start hot path📊 Changes
2 files changed (+114 additions, -20 deletions)
View changed files
📝
internal/lxc/manager.go(+83 -12)📝
internal/lxc/pve_tarball.go(+31 -8)📄 Description
Four independent latency reductions on the PVE container create/start hot path. Each is self-contained and falls back safely.
1.
allocateVMIDno longer shells out topveshpvesh get /cluster/nextidloads the entire PVE Perl API (~0.5–1s) on every invocation and runs once or twice per create. Replaced withusedVMIDs(), a direct glob of/etc/pve/lxc/*.conf+/etc/pve/qemu-server/*.conf. A package-levelvmidMu+vmidReservedset closes the same-instant race two concurrent creates would otherwise hit (reservations self-prune once committed to disk).2. ProxmoxCT-on-ZFS gets a CoW path
A UI-visible CT (
ProxmoxCT) on ZFS previously fell through tocreatePVEFromTarball, re-extracting the whole rootfs tarball viapct createon every launch. ZFS backs CT linked clones, so it now routes throughcreatePVELinkedCloneFromTarball. Ephemeral ZFS containers still take the faster rawzfs clonepath (caught first in the dispatch).3.
maybeLeaseLANDHCPPID poll rampedChanged the flat
300ms × 30init-PID poll to a20ms → 300msbackoff against a 9s deadline, matchingstartPVEContainer. A DHCP LAN container whose PID is ready fast is leased in tens of ms instead of waiting out a fixed tick.4. Per-image template locks
Replaced the single global
tmplMuwith atmplMu-guardedmap[string]*sync.Mutex(one lock per image). Launches of different images now materialize their templates in parallel; same-image launches still serialize.Notes
pvesh/pct-free — #1 and #2 benefit the lvmthin and UI-visible-CT paths, #3 only DHCP LAN containers, #4 only cold first-launches.go build ./...,go vet, and the fullgo test ./...suite pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.