Packer 1.8+ HTTP Provisioner: Latency When Concurrent Builds Run
0 reputation · 20 Aug 2022, 03:44 UTC
Packer HTTP Provisioner Concurrency Issue
The HTTP provisioner in Packer 1.8+ serves templates via a Go http.Server listening on localhost:55555 by default. When multiple builders are executed in parallel, they share the same listening port, which can create contention for incoming connections. This contention manifests as noticeable latency spikes in the build logs, even though the templates themselves are small and local.
Current documentation does not address whether the provisioner’s server is shared across all concurrent builds or if each build spins up its own instance. Additionally, there is no mention of connection pooling, request deduplication, or per-build port isolation as a mitigation strategy.
To clarify the behavior and guide configuration, we need to determine the following:
- Is the HTTP provisioner’s listening socket shared across concurrent builds, and does this sharing cause request queuing?
- Does Packer 1.8+ provide any documented configuration or recommended pattern to mitigate latency under concurrent builds?
- If separate ports per build can reduce contention, is this supported and how can it be configured?