Inventory Size Calculator
Calculate the size and structure of an Ansible inventory across groups and hosts.
About Inventory Size Calculator
An Ansible inventory's size is driven by groups × hosts-per-group, but real inventories overlap — the same host often belongs to an environment group (staging) and a role group (webservers) simultaneously. This calculator applies an 85% overlap-adjustment factor to estimate unique hosts, then multiplies by a per-host memory footprint (~1KB is typical for host vars and fact-cache pointers) to project control-node memory pressure, adding overhead if using a dynamic inventory plugin that refreshes on each run.
Formula
unique_hosts = groups × hosts_per_group × 0.85; memory_KB = unique_hosts × memory_per_host_KB × (1 + dynamic_overhead)
- groups
- Number of inventory groups
- hosts_per_group
- Average hosts per group
- memory_per_host_KB
- In-memory footprint per host object (KB)
- dynamic_overhead
- 0.2 if dynamic inventory, 0 otherwise
Worked example
With the default values below, Inventory Size Calculator returns Estimated Unique Hosts of 255. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Inventory Groupsaccepts 1–5,000 groups
- 12 groups
- Average Hosts per Groupaccepts 1–100,000 hosts
- 25 hosts
- Memory per Hostaccepts 0.1–100 KB
- 1 KB
- Dynamic Inventory
- No
Results
- Estimated Unique Hosts
- 255 hosts
- Control Node Memory Footprint
- 0.25 MB
- Total Group Memberships
- 300 memberships
- Dynamic Inventory Overhead
- 0.0 KB
Step by step
- 1Total group memberships: groups × hosts/group= 300 memberships
- 2Estimated unique hosts (85% after overlap)= 255 hosts
- 3Base memory: unique hosts × per-host memory= 255.0KB
- 4Total memory incl. dynamic inventory overhead= 255.0KB (0.25MB)
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why isn't unique hosts just groups × hosts per group?
Because inventories are commonly organized with overlapping groups (by environment, role, and region), the same physical host is often counted in several groups. The 85% factor is a rough correction; your actual overlap depends on inventory structure.
Does inventory size affect playbook run time?
Indirectly — a larger inventory increases fact-gathering and connection setup time, but the direct driver of runtime is host count divided by forks, not group count.
What's the memory overhead of dynamic inventory plugins?
Dynamic inventory sources (AWS EC2, Azure, GCP plugins) re-query the source and rebuild the in-memory inventory graph on every run, which typically adds 15-25% overhead versus a static YAML/INI inventory.
At what inventory size should I worry about performance?
Inventories beyond a few thousand hosts often benefit from splitting into multiple inventory files, using `--limit`, or adopting an inventory plugin with caching to avoid re-parsing the full host list on every run.
