---
layout: docs
page_title: Autoscaling
description: |-
  Overview of the Nomad Autoscaler that provides horizontal application and
  cluster scaling.
---

# Nomad Autoscaler Overview

This section details the Nomad Autoscaler, a horizontal application and cluster
autoscaler for Nomad. The Nomad Autoscaler is built and released separately to
Nomad. It runs as a daemon process, often referred to as the [Autoscaler Agent][autoscaler_agent].
An Autoscaler Agent is a separate and distinct process from a Nomad Agent. The
source code can be viewed on [GitHub][autoscaler_github] and releases are available
on the [HashiCorp releases page][autoscaler_releases] or via [Docker Hub][autoscaler_dockerhub].

The Nomad Autoscaler repository includes a number of [demos][autoscaler_demo]
which provide guided learning on running the Nomad AutoScaler. Since Autoscaler
Agent runs as its own daemon, it requires its own configuration. Configuration
can be passed as command line flags or parsed from a configuration file. The demos
repository includes an example [config][autoscaler_config] file that is useful to
reference when configuring your Autoscaler Agent.

## Horizontal Application Autoscaling

Horizontal application autoscaling is the process of automatically controlling the
number of instances of an application to have sufficient work throughput to meet
service-level agreements (SLA). In Nomad, horizontal application autoscaling can
be achieved by modifying the number of allocations in a task group based on the
value of a relevant metric, such as CPU and memory utilization or number of open
connections. This is enabled by configuring [autoscaling policies][autoscaling_policy]
on individual Nomad jobs using the [`scaling` block][scaling_block].

## Horizontal Cluster Autoscaling

Horizontal cluster autoscaling is the process of adding or removing Nomad clients
from a cluster to ensure there is an appropriate amount of cluster resource for
the scheduled applications. This is achieved by interacting with remote providers
to start or terminate new Nomad clients based on metrics such as the remaining
free schedulable CPU or memory. Cluster scaling is enabled by configuring the
[autoscaler agent](/nomad/tools/autoscaling/agent#dir) with policies targeting the Nomad
cluster.

## Dynamic Application Sizing

<EnterpriseAlert>
  This functionality only exists in Nomad Autoscaler Enterprise. This is not
  present in the open source version of Nomad Autoscaler.
</EnterpriseAlert>

Dynamic Application Sizing enables organizations to optimize the resource
consumption of applications using sizing recommendations from Nomad. It evaluates,
processes and stores historical task resource usage data, making recommendations
for CPU and Memory resource parameters. The recommendations can be calculated
using a number of different algorithms to ensure the recommendation best fits
the application profile.

Dynamic Application Sizing can be enabled on an individual task by configuring
[autoscaling policies][autoscaling_policy] within the task block using the job
specification [`scaling` block][scaling_block].

[scaling_block]: /nomad/docs/job-specification/scaling#scaling-block
[autoscaling_policy]: /nomad/tools/autoscaling/policy
[autoscaler_github]: https://github.com/hashicorp/nomad-autoscaler
[autoscaler_releases]: https://releases.hashicorp.com/nomad-autoscaler/
[autoscaler_dockerhub]: https://hub.docker.com/r/hashicorp/nomad-autoscaler
[autoscaler_demo]: https://github.com/hashicorp/nomad-autoscaler-demos
[autoscaler_config]: https://github.com/hashicorp/nomad-autoscaler-demos/blob/1ecd9f32c749f1faaf4154b8a7e57fa68642fd33/cloud/demos/on-demand-batch/aws/jobs/autoscaler.nomad.tpl#L20
[autoscaler_agent]: /nomad/tools/autoscaling/agent
