Ansible - Understanding Throttle (Parallelism)

throttle set's a limit on the number of workers that are used when performing a task. 

Let's say you have a task that requires a lot of CPU or memory. In this example, let's say the foo.sh script will require a lot of CPU or memory. The throttle parameter can be used to limit the number of workers (1 worker in this example).

---
- hosts: all
  tasks:
    - name: run foo.sh
      script: /path/to/foo.sh
      throttle: 1
...

 

Be aware that forks (set a limit on the number of managed nodes that will processes a playbook simultaneously) and serial (set a limit on the number or percentage of managed nodes that will process a playbook) will take precedence over throttle. For example, if you have set a limit of 5 forks, and throttle is set to 10, forks will take precedence at 5.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter f7a24 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |