selinon.strategies package¶
Module contents¶
Prepared functions for scheduling dispatcher.
Dispatcher strategy configuration functions. All of them are receiving a dict as a first argument containing:
- previous_retry - value of previous retry, None if scheduling for the first time
- active_nodes - active nodes within the system
- failed_nodes - failed nodes within the system
- new_started_nodes - newly started nodes in the system, these nodes are already in active_nodes
- new_fallback_nodes - newly started fallback nodes, these nodes are already in active_nodes
- finished nodes - already finished nodes
Other parameters are specific for strategy function and are configurable from YAML configuration file.
-
selinon.strategies.
biexponential_adapt
(status, start_retry, max_retry)[source]¶ Increase exponentially if no node started, decrease exponentially if a node scheduled.
Parameters: - status – flow status dict
- start_retry – starting retry to use
- max_retry – upper limit of scheduling
-
selinon.strategies.
biexponential_decrease
(status, start_retry, stop_retry)[source]¶ Decrease by div 2 each time if no node started, decrease to stop_retry if a node scheduled.
Parameters: - status – flow status dict
- start_retry – starting retry to use
- stop_retry – upper limit of scheduling
-
selinon.strategies.
biexponential_increase
(status, start_retry, max_retry)[source]¶ Increase exponentially if no node started, decrease drastically to start_retry if a node scheduled.
Parameters: - status – flow status dict
- start_retry – starting retry to use
- max_retry – upper limit of scheduling
-
selinon.strategies.
constant
(status, retry)[source]¶ Schedule constantly.
Parameters: - status – flow status dict
- retry – constant retry timeout
-
selinon.strategies.
linear_adapt
(status, start_retry, max_retry, step)[source]¶ Increase linearly if no node started, decrease linearly if a node scheduled.
Parameters: - status – flow status dict
- start_retry – starting retry to use
- max_retry – upper limit of scheduling
- step – step to use in linear increase
-
selinon.strategies.
linear_increase
(status, start_retry, max_retry, step)[source]¶ Increase linearly if no node started, decrease drastically to start_retry if no node scheduled.
Parameters: - status – flow status dict
- start_retry – starting retry to use
- max_retry – upper limit of scheduling
- step – step to use in linear increase