ee82e1d01e
* remove all CircleCI files * remove references to CircleCI * remove more references to CircleCI * pin golangci-lint to v1.51.1 instead of v1.51 |
||
---|---|---|
.. | ||
packer | ||
terraform | ||
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
- Download all necessary tools listed (Terraform, Packer)
- Set up an AWS account and a Datadog account - downloading the Datadog client is not necessary.
- 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
, andAWS_DEFAULT_REGION
environment variables. - Follow the Packer README to generate your load test and Consul AMIs
- Follow the Terraform README to stand up the infrastructure in AWS
- 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.