Deployment autoscaling

edit

Autoscaling helps you to more easily manage your deployments by adjusting their available resources automatically. Currently, autoscaling is supported for Elasticsearch data tiers and machine learning nodes. See the following sections to learn more:

You can also have a look at our autoscaling example, as well as a sample request to create an autoscaled deployment through the API.

Overview

edit

When you first create a deployment it can be challenging to determine the amount of memory and storage that you need, and even more so to predict these requirements for weeks or months into the future. These resources ideally should be sized to both ensure efficient performance and to avoid excess costs. Autoscaling can help with this balance by adjusting the resources available to a deployment automatically as loads change over time, reducing the need for manual intervention.

Currently, autoscaling behavior is as follows:

  • Data tiers

    • Each Elasticsearch data tier scales upward as needed. Scaling first adds capacity to a single instance, until it has reached its maximum instance size per tier, and then new instances are added as needed.
    • You can set the maximum size per zone. Autoscaling downward is not currently supported on a data tier, however you can set the current size of each data tier manually.
    • The determination of when to scale is based on past and present storage usage.
  • Machine learning nodes

    • Machine learning nodes can scale upward and downward. To scale upward, capacity is added to the first machine learning instance until it reaches its maximum amount of RAM per instance, and then additional instances are added as needed.
    • You can set the maximum and minimum size per zone.
    • The determination of when to scale is based on the expected memory requirements for the currently configured machine learning jobs.

There is always a limit on how large a data tier can scale, and for machine learning nodes both a maximum and minimum limit are set. The maximum size setting prevents the possibility, for example, of a runaway application triggering a scaling event that results in unplanned costs.

For any Elastic Cloud Enterprise Elasticsearch component the number of availability zones is not affected by autoscaling. You can always set the number of availability zones manually.

When does autoscaling occur?

edit

Several factors determine when data tiers or machine learning nodes are scaled. For a data tier, an autoscaling event can be triggered based on an assessment of how shards are currently allocated, and the amount of storage and buffer space currently available. Scaling can also be triggered on a hot tier when past behavior, over the duration of the forecast window, indicates that the influx of data can increase significantly in the near future. See Reactive storage decider and Proactive storage decider for more detail.

On machine learning nodes, scaling is determined by an estimate of the memory requirement for the currently configured jobs. When a new machine learning job tries to start, it looks for a node with adequate native memory capacity. If one cannot be found, it stays in an opening state. If this waiting job exceeds the queueing limit set in the machine learning decider, a scale up is requested. Conversely, as machine learning jobs run, their memory usage might decrease or other running jobs might finish or close. In this case, if the duration of decreased resource usage exceeds the set value for down_scale_delay, a scale down is requested. See Machine learning decider for more detail. To learn more about machine learning jobs in general, see Create anomaly detection jobs.

On a highly available deployment, autoscaling events are always applied to instances in each availability zone simultaneously, to ensure consistency.

Notifications

edit

In the event that a data tier or machine learning node scales up to its maximum possible size, a notice appears on the deployment overview page prompting you to adjust your autoscaling settings in order to ensure optimal performance.

A warning is also issued in the ECE service-constructor logs with the field labels.autoscaling_notification_type and a value of data-tier-at-limit (for a fully scaled data tier) or ml-tier-at-limit (for a fully scaled machine learning node). The warning is indexed in the logging-and-metrics deployment, so you can use that event to configure an email notification.

Restrictions and limitations

edit

The following are known limitations and restrictions with autoscaling:

  • Autoscaling is available starting in Elastic stack version 7.11.
  • Autoscaling is not available in Elastic Cloud Enterprise on custom deployment templates. To enable autoscaling you need to use one of the built-in deployment templates. Note that you can modify the built-in deployment templates, for example to adjust some of the autoscaling default settings.
  • In the event that an override is set for the disk quota multiplier for an instance by means of the ElasticsearchClusterInstanceSettingsOverrides API, autoscaling does not use the new override settings. Autoscaling always adjusts storage and memory capacity based on the memory to storage ratio that is set for each default instance configuration. It’s recommended to avoid adjusting the disk quote multiplier for an instance that uses autoscaling, since the setting is not used.

Enable or disable autoscaling

edit

To enable or disable autoscaling on a deployment:

  1. Log into the Cloud UI.
  2. On the Deployments page, select your deployment.

    Narrow the list by name, ID, or choose from several other filters. To further define the list, use a combination of filters.

  3. In your deployment menu, click Edit.
  4. Select or deselect Autoscale this deployment.
  5. Click Confirm to have the autoscaling change and any other settings take effect. All plan changes are shown on the Deployment Activity page.

When autoscaling has been enabled, the data tiers and machine learning nodes resize according to the autoscaling settings. Current sizes are shown on the deployment overview page.

When autoscaling has been disabled, you need to adjust the size of data tiers and machine learning nodes manually.

Update your autoscaling settings

edit

Each autoscaling setting is configured with a default value. You can adjust these if necessary, as follows:

  1. Log into the Cloud UI.
  2. On the Deployments page, select your deployment.

    Narrow the list by name, ID, or choose from several other filters. To further define the list, use a combination of filters.

  3. In your deployment menu, click Edit.
  4. To update a data tier:

    1. Click Edit Settings on the data tier that you want to adjust. A panel opens, showing both the current size per availability zone and the maximum size per availability zone.
    2. Set the Maximum size per zone to the largest amount of resources that should be allocated to the data tier automatically. The resources will not scale above this value.
    3. You can also update the Current size per zone. If you update this setting to match the Maximum size per zone, the data tier will remain at that size.
    4. For a hot data tier, under Advanced settings you can also adjust the Forecast window. This is the duration of time, up to the present, for which past storage usage is assessed in order to predict when additional storage is needed.
    5. Click Update. The Edit Settings pane closes.
    6. Click Save to apply the changes to your deployment.
  5. To update machine learning nodes:

    1. Click Edit Settings on the machine learning nodes. A panel opens, showing the minimum and maximum size per availability zone.
    2. Set the Minimum size per zone and Maximum size per zone to the smallest and largest amount of resources, respectively, that should be allocated to the nodes automatically. The resources allocated to machine learning will not exceed these values.
    3. Click Update. The Edit Settings pane closes.
    4. Click Save to apply the changes to your deployment.

You can also view our example of how the autoscaling settings work.

On Elastic Cloud Enterprise, system-owned deployment templates include the default values for all deployment autoscaling settings.