consul/test/load
hashicorp-copywrite[bot] 5fb9df1640
[COMPLIANCE] License changes (#18443)
* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 09:12:13 -04:00
..
packer [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
terraform [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
README.md
loadtestdiagram.png

README.md

Terraform Consul Load Testing

Consul Load Testing is used to capture baseline performance metrics for Consul under stress. This will assist in ensuring there are no performance regressions during releases and substantial changes to Consul. Per the defaults, the test runs for 10 minutes with 25 virtual users spawned by k6. Instance sizes for test instances are t2.small and for the Consul cluster m5n.large. All metrics from Consul are pushed to a datadog dashboard for user review.

This relies on the Gruntwork's Terraform AWS Consul Module which by default creates 3 Consul servers across 3 availability zones. A load test instance which has an image that is configured with the necessary scripts and k6 is created and sends traffic to a load balancer. The load balancer will distribute requests across the Consul clients who will ultimately forward the requests to the servers.

How to use

Terraform and Packer, AWS and Datadog are required to use this. All of this, except the AWS resources that will be utilized, are free.

This repo has the following folder structure:

  • packer: This contains all the necessary stuff to make the load test and the Consul AMI to be utilized in Terraform.
  • terraform: This contains all the relevant Terraform files

Getting Started

  1. Download all necessary tools listed (Terraform, Packer)
  2. Set up an AWS account and a Datadog account - downloading the Datadog client is not necessary.
  3. Configure your AWS credentials using one of the options supported by the AWS SDK. Usually, the easiest option is to set the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION environment variables.
  4. Follow the Packer README to generate your load test and Consul AMIs
  5. Follow the Terraform README to stand up the infrastructure in AWS
  6. Watch the results in either your datadog dashboard or in the output of your Terraform Apply

Debugging in Datadog

Consul has hundreds of metrics to choose from. We recommend reading over Datadog's article that breaks down relevant Consul metrics, especially on their "communication" portion. This test runs solely based on making requests to endpoints which is what makes that section so relevant.