github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/tools/autoscaling/concepts/policy-eval/index.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: Autoscaling Policy Evaluation
     4  description: >
     5    This section covers how scaling policies are evaluated to generate scaling
     6    actions.
     7  ---
     8  
     9  # Policy Evaluation
    10  
    11  When the Nomad Autoscaler [agent] starts it loads all the policies defined in
    12  the [sources][agent_source] configured and monitors them for changes. Each
    13  policy is assigned a handler that periodically sends the policy to a broker
    14  where it is evaluated by a worker. The frequency the policy is enqueued is set
    15  by its [`evaluation_interval`][policy_eval_interval].
    16  
    17  The worker executes a series of steps by calling the different plugins used in
    18  the policy to determine if a scaling action is needed and then to apply the
    19  necessary actions. The worker then loops back to evaluate the next policy.
    20  
    21  If a scaling action is performed and the policy defines a
    22  [`cooldown`][policy_cooldown] value the policy handler waits the specified
    23  value before enqueuing it again.
    24  
    25  If the policy target are Nomad clients the target plugin will usually execute
    26  more steps, such as [selecting nodes to be removed][concepts_node_selector] and
    27  draining them.
    28  
    29  [![Scaling policy evaluation pipeline](/img/autoscaling/policy-eval.png)](/img/autoscaling/policy-eval.png)
    30  
    31  [agent]: /tools/autoscaling/agent
    32  [agent_source]: /tools/autoscaling/agent/source
    33  [concepts_node_selector]: /tools/autoscaling/concepts/policy-eval/node-selector-strategy
    34  [policy_cooldown]: /tools/autoscaling/policy#cooldown
    35  [policy_eval_interval]: /tools/autoscaling/policy#evaluation_interval