The Distributed Load Testing Solution leverages managed, highly available and highly scalable AWS services to effortlessly create and simulate thousands of connected users generating a selected amount of transactions per second. As a result, developers can understand the behavior of their applications at scale and at load to identify any bottleneck problems before they deploy to Production.
The solution is deployed using a CloudFormation template with a lambda backed custom resource. For details on deploying the solution please see the details on the solution home page: Distributed Load Testing
source/api-services
A NodeJS Lambda function for the API microservices. Integrated with Amazon API Gateway, used to manage test scenarios.
source/console
ReactJS Single page application to provide a GUI to the solutions. Authenticated through Amazon Cognito this dashboard allows users to Create tests and view the final results.
source/custom-resource
A NodeJS Lambda function used as a CloudFormation custom resource for configuring Amazon S3 bucket notifications and to send anonymous metrics.
source/results-parser
A NodeJS Lambda function used to write the xml output from the docker images to Amazon DynamoDB and generate the final results for each test.
source/task-canceler
A NodeJS Lambda function used to stop tasks for a test that has been cancelled.
source/task-runner
A NodeJS Lambda function that runs the Amazon ECS task definition for each test.
source/task-status-checker
A NodeJS Lambda function that checks if the Amazon ECS tasks are running or not.
The solution can be deployed through the CloudFormation template available on the solution home page: Distributed Load Testing. To make changes to the solution, download or clone this repo, update the source code and then run the deployment/build-s3-dist.sh script to deploy the updated Lambda code to an Amazon S3 bucket in your account.
- AWS Command Line Interface
- Node.js 14.x or later
Clone the distributed-load-testing-on-aws
GitHub repository, then make the desired code changes.
git clone https://github.com/awslabs/distributed-load-testing-on-aws.git
Run unit tests to make sure added customization passes the tests:
cd ./deployment
chmod +x ./run-unit-tests.sh
./run-unit-tests.sh
export REGION=aws-region-code # the AWS region to launch the solution (e.g. us-east-1)
export DIST_OUTPUT_BUCKET=my-bucket-name # bucket where customized code will reside
export SOLUTION_NAME=my-solution-name
export VERSION=my-version # version number for the customized code
export PUBLIC_ECR_REGISTRY=public.ecr.aws/awssolutions/distributed-load-testing-on-aws-load-tester # replace with the container registry and image if you want to use a different container image
export PUBLIC_ECR_TAG=v2.0 # replace with the container image tag if you want to use a different container image
The CloudFormation template is configured to pull the Lambda deployment packages from Amazon S3 bucket in the region the template is being launched in. Create a bucket in the desired region with the region name appended to the name of the bucket. eg: for us-east-1 create a bucket named: my-bucket-us-east-1
aws s3 mb s3://$DIST_OUTPUT_BUCKET-$REGION --region $REGION
Build the distributable:
chmod +x ./build-s3-dist.sh
./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $VERSION
Notes: The build-s3-dist script expects the bucket name as one of its parameters, and this value should not include the region suffix. In addition to that, the version parameter will be used to tag the npm packages, and therefore should be in the Semantic Versioning format.
Deploy the distributable to the Amazon S3 bucket in your account:
aws s3 cp ./regional-s3-assets/ s3://$DIST_OUTPUT_BUCKET-$REGION/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control
aws s3 cp ./global-s3-assets/ s3://$DIST_OUTPUT_BUCKET-$REGION/$SOLUTION_NAME/$VERSION/ --recursive --acl bucket-owner-full-control
- Get the link of the
distributed-load-testing-on-aws.template
uploaded to your Amazon S3 bucket. - Deploy the Distributed Load Testing on AWS solution to your account by launching a new AWS CloudFormation stack using the link of the
distributed-load-testing-on-aws.template
.
This solution uses a public Amazon Elastic Container Registry (Amazon ECR) image repository managed by AWS to store the solution container image that is used to run the configured tests. If you want to customize the container image, you can rebuild and push the image into an ECR image repository in your own AWS account. For details on how to customize the container image, please see the Container image customization section of the implementation guide.
This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the implementation guide.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0