This Guidance demonstrates how to set up a fully managed, distributed load testing solution using AWS services and Locust, an open-source load testing tool. It leverages Amazon Elastic Kubernetes Service (Amazon EKS) with AWS Fargate to create a scalable and cost-effective environment. The Guidance allows load test operators to manage the cluster through their local machine's terminal and interact with Locust's web dashboard through port forwarding. With these services, you can quickly establish a simple, secure, and scalable load testing environment that minimizes management overhead and keeps costs low.
Note: [Disclaimer]
Architecture Diagram
[Architecture diagram description]
Step 1
Create an Amazon Elastic Kubernetes Service (Amazon EKS) cluster, which spans multiple public and private subnets.
Step 2
Create an AWS Fargate profile to define the namespace and private subnets that will run the load-generating Locust pods on Fargate.
Step 3
NAT gateways on the cluster’s public subnets provide the Locust pods with the ability to generate traffic towards the external target.
Step 4
The load test operator interacts with the Amazon EKS cluster using simple AWS CLI and kubectl commands through the terminal.
Step 5
Using the provided deployment files, the load test operator can customize and deploy the Locust control and Locust worker pods, containing a particular load testing script in a Fargate-managed node.
Step 6
A ClusterIP service is created to facilitate communication within the cluster.
Step 7
Once containers are up and running, the load is generated towards the external target according to the load testing script.
Step 8
The load test operator initiates port forwarding to the Locust control pod and accesses its web dashboard through a local web browser.
Get Started
Deploy this Guidance
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
Amazon EKS packages, manages, and deploys applications in a lightweight, portable, and efficient manner. Fargate automatically provisions, scales, and manages the nodes your containers run on, simplifying infrastructure management. Use Locust to efficiently simulate high-concurrency, distributed load on your applications, uncovering potential issues and gaining valuable insights. By harnessing these powerful tools and services, you can create a secure, scalable, and fully-managed load testing environment, allowing you to evaluate your system's performance under realistic conditions and proactively address any bottlenecks, inefficiencies, or service degradation.
-
Security
Fargate removes the attack surface associated with securing the underlying infrastructure, reducing the risk of vulnerabilities and misconfigurations. Fargate also deploys your workloads in private subnets, isolating them from direct internet access and minimizing the risk of unauthorized access. AWS Identity and Access Management (IAM) secures your workloads by providing fine-grained control over user and resource permissions, so that only authorized entities can access and interact with your AWS resources. By offloading the responsibility of securing the hardware and network environment, you can focus on safeguarding your application and mitigating the risks associated with manual configurations and human errors.
-
Reliability
Conduct thorough load testing to simulate varying levels of user traffic and load, revealing whether your application's scaling mechanisms are working as expected and scaling thresholds are properly configured. This process exposes pain points and allows you to implement robust error handling, graceful degradation, circuit breakers, and other fault-tolerance mechanisms, leading to more resilient, self-healing applications that handle downtime better and maintain critical functionality under stress.
-
Performance Efficiency
Leverage AWS CLI, Terraform, and kubectl to programmatically define, deploy, and scale your infrastructure and applications, enabling faster provisioning, more consistent configurations, and better utilization of resources compared to manual, error-prone processes. By automating these tasks, you can streamline your operations, reduce the risk of human errors, and focus your engineering efforts on more value-adding activities.
-
Cost Optimization
Use Fargate to only pay for the compute resources your containers actually consume, avoiding expenses associated with idle, over-provisioned, self-managed resources needed to handle peak loads. The serverless nature of Fargate also removes the costs and operational overhead related to infrastructure management. Locust.io, a free and open-source load testing framework, offers the benefits of a powerful testing tool at no cost. By optimizing your resource utilization and leveraging cost-effective solutions, you can maximize the return on your investment and redirect resources towards more strategic initiatives.
-
Sustainability
Fargate reduces your infrastructure footprint and environmental impact, as AWS data centers are designed for optimal energy efficiency and powered by renewable energy sources. Additionally, the dynamic scaling capabilities of Fargate also leads to more efficient use of energy and resources. Use Locust, an event-based load testing framework, to simulate large-scale, real-world load conditions without requiring extensive hardware or infrastructure, further contributing to your sustainability efforts.
Related Content
[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.