1
0

batch.rst 1.1 KB

123456789101112131415161718192021222324252627282930
  1. .. _targeting-batch:
  2. Batch Size
  3. ----------
  4. The ``-b`` (or ``--batch-size``) option allows commands to be executed on only
  5. a specified number of minions at a time. Both percentages and finite numbers are
  6. supported.
  7. .. code-block:: bash
  8. salt '*' -b 10 test.version
  9. salt -G 'os:RedHat' --batch-size 25% apache.signal restart
  10. This will only run test.version on 10 of the targeted minions at a time and then
  11. restart apache on 25% of the minions matching ``os:RedHat`` at a time and work
  12. through them all until the task is complete. This makes jobs like rolling web
  13. server restarts behind a load balancer or doing maintenance on BSD firewalls
  14. using carp much easier with salt.
  15. The batch system maintains a window of running minions, so, if there are a
  16. total of 150 minions targeted and the batch size is 10, then the command is
  17. sent to 10 minions, when one minion returns then the command is sent to one
  18. additional minion, so that the job is constantly running on 10 minions.
  19. .. versionadded:: 2016.3
  20. The ``--batch-wait`` argument can be used to specify a number of seconds to
  21. wait after a minion returns, before sending the command to a new minion.