Class LeastLoadBalancer
- All Implemented Interfaces:
ExtensionPoint
LoadBalancer implementation that the leastload plugin uses to replace the default
Jenkins LoadBalancer
The LeastLoadBalancer chooses Executors that have the least load. An Executor is defined
as having the least load if it is idle or has the most available Executors
Only executor chunks that are clearly available (node non-null, not offline) are considered. The balancer tracks nodes that have not yet been assigned work this "round"; it assigns to a known-empty node uniquely. When all tracked nodes have been used, it re-checks Jenkins for currently available nodes (online, accepting tasks, with idle executors) and starts a new round. This spreads load and avoids multiple jobs piling on the same agent before queue maintenance runs again.
When least-load cannot produce a mapping, it returns null so the task remains in the queue for the next cycle.
The fallback load balancer is used only when least-load is disabled for the job via LeastLoadDisabledProperty.
- Author:
- brendan.nolan@gmail.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.LoadBalancer
CONSISTENT_HASH, DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionLeastLoadBalancer(LoadBalancer fallback) Create theLeastLoadBalancerwith a fallback that will be used in case of any failures. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the fallbackLoadBalancermap(Queue.Task task, MappingWorksheet ws) static voidregister()Methods inherited from class hudson.model.LoadBalancer
sanitize
-
Constructor Details
-
LeastLoadBalancer
Create theLeastLoadBalancerwith a fallback that will be used in case of any failures.- Parameters:
fallback- TheLoadBalancerfallback to use in case of failure
-
-
Method Details
-
register
-
map
- Specified by:
mapin classLoadBalancer
-
getFallBackLoadBalancer
Retrieves the fallbackLoadBalancer- Returns:
- - fallback
LoadBalancer
-