elastic-cloud-autoscaler-demo

command module
v0.0.0-...-01185cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

elastic-cloud-autoscaler-demo

Demo of https://github.com/k-yomo/elastic-cloud-autoscaler

⚠️ Running the demo will cost money.

Prerequisites

  • Elastic Cloud subscription
  • Go v.1.19.x
  • Terraform v1.3.6
  • k6
  • direnv
  • Git LFS

Setup

Create Elastic Cloud's API key and set it to env variable. You can create API key in the below page. https://cloud.elastic.co/deployment-features/keys

$ export EC_API_KEY=
  1. Run setup command. It'll create required deployments and elasticsearch index.
$ make setup
  1. Run index-products command. It'll index 1.7M documents. The data Shopping Queries Dataset published from Amazon.
$ make index-products

Usage

$ make run

It'll check if scaling is needed and apply the change if any per minute based on the given configuration. When scaling is applied, it'll print scaling operation like below.

==============================================
scaling direction: SCALING_OUT
topology size updated from: 65536 => to 131072
replica num updated from: 1 => to 3
reason: current or desired topology size '64g' is less than min topology size '128g'
==============================================

To increase CPU util, make loadtest command will send search requests using k6. It'll gradually increase traffic and then decrease, so you can see the scale-out and scale-in.

$ make loadtest

Cleanup

cleanup command will destroy created resources

$ make cleanup

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
scripts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL