When executing jobs from the Salt master CLI using batch commands (e.g., salt '*' -b 20 state.apply), the initial batch processes at the specified size. However, subsequent batches are observed to run with variable sizes smaller than the configured value.
This behavior often leads to concerns regarding execution consistency and whether a fixed batch size can be enforced.
Aria Automation Config 8.17.x
This is expected behavior by design. Salt implements a Sliding Window (Worker Model) for batch execution to prioritize performance and resource optimization.
Upon the completion of a job on a single target, the next available target in the queue is immediately processed. This mechanism ensures continuous utilization of available execution slots.
Because jobs complete at varying intervals across different nodes, subsequent batches will dynamically adjust and may appear smaller than the initially configured batch limit.
A Fixed Window (Lock-step Model), which would enforce strictly consistent batch sizes by waiting for all nodes in a batch to finish before proceeding, is less efficient and is not supported by the Salt architecture.
The observed behavior is the result of Salt's native Sliding Window (Worker Model) execution architecture. Rather than waiting for a complete, static block of targets to finish simultaneously (Lock-step), Salt immediately assigns the next available target in the queue as soon as an individual job completes.
This design dynamically scales the active batch to ensure continuous utilization of execution slots and optimize performance.