How to know the max of forks that ansible can really handle. When i set --forks to 100, does it really launch 100 tasks in prallel if i have more than 100 hosts for example or there is a maximum that ansible could not exceed ? It depends on what actually ?
In terms of the maximum number of forks based on CPU and memory, the only documentation around maximum forks per hardware requirements can be found in the Ansible Tower documentation:
4 GB RAM is recommended per 100 forks... about 100MB per fork... The baseline value for [CPU capacity for forks] is 4 forks per core.
Now, this actually becomes more complicated if you want to optimize by more than just a that broad rule. The documentation provides formulas and algorithms that you can use to determine maximum forks based on hardware specifications. This comes from the capacity determination documentation.
Note that in those formulas you should disregard the factors included as part of Ansible Tower overhead. Also note that indeed in one place the documentation claims 100MB per fork and elsewhere claims 4GB per 100 forks which are mathematically incongruous.