Task Execution Time Calculator
Estimate total time for Ansible tasks to complete across all target hosts.
About Task Execution Time Calculator
Total playbook time has two components: the actual task work (tasks × average duration) and one-time-per-host connection setup (SSH handshake, becoming root, Python interpreter discovery). This model assumes pipelining/ControlPersist is enabled so connection setup is paid once per host per run rather than once per task per host — without those optimizations, connection overhead can dominate total run time.
Formula
total_sec = tasks × avg_duration_sec + connection_setup_sec × hosts
- tasks
- Number of tasks in the playbook
- avg_duration_sec
- Average duration per task per host (seconds)
- connection_setup_sec
- SSH handshake/auth time per host
- hosts
- Number of target hosts
Worked example
With the default values below, Task Execution Time Calculator returns Total Estimated Run Time of 1.67. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Number of Tasksaccepts 1–10,000 tasks
- 40 tasks
- Average Task Durationaccepts 0.01–600 seconds
- 1.5 seconds
- Connection Setup Timeaccepts 0–60 seconds
- 0.8 seconds
- Hostsaccepts 1–100,000 hosts
- 50 hosts
Results
- Total Estimated Run Time
- 1.67 min
- Connection Overhead Share
- 40.0%
- Task Execution Time
- 60.0 seconds
- Connection Setup Time
- 40.0 seconds
Step by step
- 1Task work: tasks × avg duration= 60.0s
- 2Connection overhead: setup × hosts= 40.0s
- 3Total time: task work + connection overhead= 100.0s (1.67 min)
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 is connection overhead per host, not per task?
With SSH ControlPersist and pipelining enabled (recommended), Ansible reuses one SSH connection for the whole play against a host, so the connection cost is amortized across all tasks rather than repeated for every task.
What if pipelining is disabled?
Without pipelining, Ansible copies a module file to the remote host and executes it in a separate step for every task, which can multiply connection-related overhead — model this by using a higher 'connection setup time' input to approximate the extra round trips.
How can I reduce task work time?
Batch related operations into fewer, coarser tasks (e.g. one `package` call with a list instead of one task per package), use `async`/`poll` for long-running tasks, and avoid `command`/`shell` when a native module with less overhead exists.
Does this account for parallelism across hosts?
No — this estimates work per host. Combine with the Host Parallelism Calculator to see how forks reduce the wall-clock time of running this workload across your full host count.
