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

     1  ---
     2  layout: docs
     3  page_title: Autoscaling
     4  description: |-
     5    Overview of the Nomad Autoscaler that provides horizontal application and
     6    cluster scaling.
     7  ---
     8  
     9  # Nomad Autoscaler Overview
    10  
    11  This section details the Nomad Autoscaler, a horizontal application and cluster
    12  autoscaler for Nomad. The Nomad Autoscaler is built and released separately to
    13  Nomad. It runs as a daemon process, often referred to as the [Autoscaler Agent][autoscaler_agent].
    14  An Autoscaler Agent is a separate and distinct process from a Nomad Agent. The 
    15  source code can be viewed on [GitHub][autoscaler_github] and releases are available
    16  on the [HashiCorp releases page][autoscaler_releases] or via [Docker Hub][autoscaler_dockerhub].
    17  
    18  The Nomad Autoscaler repository includes a number of [demos][autoscaler_demo]
    19  which provide guided learning on running the Nomad AutoScaler. Since Autoscaler
    20  Agent runs as its own daemon, it requires its own configuration. Configuration
    21  can be passed as command line flags or parsed from a configuration file. The demos
    22  repository includes an example [config][autoscaler_config] file that is useful to
    23  reference when configuring your Autoscaler Agent.
    24  
    25  ## Horizontal Application Autoscaling
    26  
    27  Horizontal application autoscaling is the process of automatically controlling the
    28  number of instances of an application to have sufficient work throughput to meet
    29  service-level agreements (SLA). In Nomad, horizontal application autoscaling can
    30  be achieved by modifying the number of allocations in a task group based on the
    31  value of a relevant metric, such as CPU and memory utilization or number of open
    32  connections. This is enabled by configuring [autoscaling policies][autoscaling_policy]
    33  on individual Nomad jobs using the [`scaling` block][scaling_block].
    34  
    35  ## Horizontal Cluster Autoscaling
    36  
    37  Horizontal cluster autoscaling is the process of adding or removing Nomad clients
    38  from a cluster to ensure there is an appropriate amount of cluster resource for
    39  the scheduled applications. This is achieved by interacting with remote providers
    40  to start or terminate new Nomad clients based on metrics such as the remaining
    41  free schedulable CPU or memory. Cluster scaling is enabled by configuring the
    42  [autoscaler agent](/tools/autoscaling/agent#dir) with policies targeting the Nomad
    43  cluster.
    44  
    45  ## Dynamic Application Sizing
    46  
    47  <EnterpriseAlert>
    48    This functionality only exists in Nomad Autoscaler Enterprise. This is not
    49    present in the open source version of Nomad Autoscaler.
    50  </EnterpriseAlert>
    51  
    52  Dynamic Application Sizing enables organizations to optimize the resource
    53  consumption of applications using sizing recommendations from Nomad. It evaluates,
    54  processes and stores historical task resource usage data, making recommendations
    55  for CPU and Memory resource parameters. The recommendations can be calculated
    56  using a number of different algorithms to ensure the recommendation best fits
    57  the application profile.
    58  
    59  Dynamic Application Sizing can be enabled on an individual task by configuring
    60  [autoscaling policies][autoscaling_policy] within the task stanza using the job
    61  specification [`scaling` block][scaling_block].
    62  
    63  [scaling_block]: /docs/job-specification/scaling#scaling-stanza
    64  [autoscaling_policy]: /tools/autoscaling/policy
    65  [autoscaler_github]: https://github.com/hashicorp/nomad-autoscaler
    66  [autoscaler_releases]: https://releases.hashicorp.com/nomad-autoscaler/
    67  [autoscaler_dockerhub]: https://hub.docker.com/r/hashicorp/nomad-autoscaler
    68  [autoscaler_demo]: https://github.com/hashicorp/nomad-autoscaler-demos
    69  [autoscaler_config]: https://github.com/hashicorp/nomad-autoscaler-demos/blob/1ecd9f32c749f1faaf4154b8a7e57fa68642fd33/cloud/demos/on-demand-batch/aws/jobs/autoscaler.nomad.tpl#L20
    70  [autoscaler_agent]: /tools/autoscaling/agent