Reproducible benchmark harness to measure Ansible runtime overhead and the speedup from Mitogen.
This repo is intentionally small and boring: pinned dependencies, a single benchmark playbook, and a single command to run A/B tests.
- Runs the same playbook twice using
hyperfine- baseline: plain
ansible-playbook - Mitogen:
ANSIBLE_STRATEGY=serverscom.mitogen.mitogen_linear
- baseline: plain
- Targets
localhostby default, so anyone can reproduce the results - Can target remote hosts if you replace the inventory
Classic Ansible pays per-task overhead: staging modules, starting Python, imports, and process churn.
Mitogen keeps persistent Python interpreters and drives modules via RPC over SSH, which removes much of that overhead.
uvhyperfinego-task(Task)ansible-coreis installed viauvfrompyproject.toml
task deps
task galaxy-deps
task benchThe benchmark command is:
hyperfine --warmup 1 --runs 3 \
'uv run ansible-playbook playbooks/bench.yml' \
'ANSIBLE_STRATEGY=serverscom.mitogen.mitogen_linear uv run ansible-playbook playbooks/bench.yml'Default inventory runs locally (no SSH).
To benchmark remote hosts, change the inventory used by the playbook (or update the inventory file in this repo) and rerun task bench.
Full write-up with diagrams, methodology, and real numbers:
Taskfile.ymlansible.cfgplaybooks/bench.ymlrequirements.yml.pre-commit-config.yaml
This repo is a benchmark harness, not a Mitogen support project. If you hit a Mitogen bug, upstream issue tracker is the right place.