ansible/ansible — pull request #3650 by bcoca (2013-07-24 00:58:03+00:00)
Title: forking least possible

now if you set fork to 0 or a number higher than the number of hosts it will be readjusted to the number of hosts runner is going to deal with.
Signed-off-by: Brian Coca

Did this a few dozen times and results were pretty consistent, needs a lot of testing, specially with multiple plays per book.

test: time ansible -m setup -f 50 -i 'localhost,' localhost -c local > /dev/null

Before:
real 0m3.240s
user 0m1.820s
sys 0m0.880s

After:
real 0m1.291s
user 0m0.860s
sys 0m0.180s