You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
-[Load testing a basic HTTP endpoint](https://github.com/aws-samples/distributed-load-testing-using-aws-fargate/tree/master/examples/http)
32
-
-[Load testing an Elasticsearch cluster behind a VPC](https://github.com/aws-samples/distributed-load-testing-using-aws-fargate/tree/master/examples/elasticsearch)
33
-
-[Coming next] Simulating IoT devices for load testing.
-[Load testing an Elasticsearch cluster behind a VPC](https://github.com/aws-samples/distributed-load-testing-using-aws-fargate/tree/master/examples/elasticsearch)
35
33
36
34
37
35
## Getting Started
38
36
39
-
### 1. Clone this repository
37
+
### 1. Launch Solution
38
+
39
+
In this step you will launch the `Master` CloudFormation stack that will create a Fargate Cluster, an ECR Docker registry, an IAM
40
+
Execution Role, a Task Definition, a CloudWatch Log Group, a Security Group and a new VPC with Public Subnets.
41
+
42
+
Region Name | Region Code | Launch
43
+
------|-----|-----
44
+
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
45
+
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
46
+
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
47
+
48
+
You will notice that the CloudFormation stack will expand itself into 2 additional nested stacks: The master stack takes
49
+
care of creating global resources like an ECR Registry and the IAM Execution Role. One nested stack takes care of
50
+
creating the network (VPC) and the other creates the Fargate cluster.
51
+
52
+
Once the three stacks have completed deployment, you need to make a note of the Output values in the master stack
53
+
(see the following Screenshot) as you will need these values later. Go to the Outputs section of the
54
+
master stack and save the DockerRegistryName and DockerRegistryURL values somewhere in your notes.
Switch to the latest release so you have an stable code base.
65
+
66
+
```bash
67
+
git checkout tags/v0.2-beta
68
+
```
69
+
70
+
### 3. Modify the load test scenario
46
71
47
72
Configure your test scenario by editing the `examples/http/taurus.yml` file.
48
-
To can learn more about the syntax of this file, check the Taurus docs: https://gettaurus.org/kb/Index .
73
+
To learn more about the syntax of this file, check the Taurus docs: https://gettaurus.org/kb/Index .
49
74
50
75
```yaml
51
76
execution:
@@ -60,66 +85,43 @@ scenarios:
60
85
- http://aws.amazon.com
61
86
```
62
87
63
-
### 3. Build and publish the docker image
64
-
65
-
Once you have completed your test scenario. You need to package it in a Docker image and publish it
66
-
in the Docker Hub or in a private registry of your choice.
88
+
### 4. Build and push the docker image
67
89
68
-
For simplicity, I'm going to use the public Docker Hub. If you don't have an account, go ahead and create one in
69
-
https://hub.docker.com. Then login from the terminal:
90
+
Once you have completed your test scenario, you need to package it in a Docker image and push it to your ECR Docker registry.
91
+
To do this, you first need to authenticate against ECR. The following command assumes you have the [AWS CLI installed and configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html).
which allow you to create resources on multiple accounts and regions at once. There is some IAM work that needs to be
105
-
done in your account to use StackSets, but it's worth the effort.
106
-
107
-
The CloudFormation template will ask for a few basic parameters and will create everything needed to run Fargate on AWS;
108
-
including a VPC, 3 public subnets in different AZs, a security group, an internet gateway, a route table, a CloudWatch
109
-
group, a CloudWatch Log Filter, an IAM role for the tasks, an ECS cluster and the Task Definition for Fargate.
110
-
111
-

112
-
113
-
-**VpcCidrBlock**. CIDR block of the VPC that will be created for the cluster to run on.
114
-
-**SubnetACidrBlock**. CIDR block of Subnet A in the VPC.
115
-
-**SubnetBCidrBlock**. CIDR block of Subnet B in the VPC.
116
-
-**SubnetCCidrBlock**. CIDR block of Subnet C in the VPC.
117
-
-**DockerImage**. Specify the docker image that you published to the DockerHub.
118
-
-**DockerTaskCpu**. Number of CPU units to assign to the Fargate tasks ([Task Size Reference](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size)).
119
-
-**DockerTaskMemory**. Memory in MB to assign to the Fargate tasks ([Task Size Reference](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size))
120
-
-**FargateClusterName**. Name of your cluster so you can identify it in the ECS Console.
120
+
```bash
121
+
docker push {DockerRegistryURL}:latest
122
+
```
121
123
122
-
### 5. Run the tests
124
+
### 4. Run the tests in Fargate
123
125
124
126
Finally, edit the `bin/runner.py` python file to add the list of regions with its CloudFormation stack names that
125
127
you launched on the previous step. This python file will read the CloudFormation outputs and based on those parameters
@@ -152,7 +154,7 @@ And finally, when you are ready to run the Distributed Load Test, run the script
152
154
python runner.py
153
155
```
154
156
155
-
### 6. Monitor the tests in CloudWatch
157
+
### 5. Monitor the test execution in CloudWatch
156
158
157
159
The CloudFormation template should have created a [CloudWatch Metric Filter](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)
158
160
that will capture the average response time for each HTTP request that was issued to your system under test. You should
@@ -181,3 +183,19 @@ The Dashboard will look something like this:
181
183
182
184

183
185
186
+
## Launch in Additional Regions (Optional)
187
+
188
+
It may be likely that running this solution from a single AWS region is enough to load test your application. However,
189
+
if you want to take it a step further, you can do so by deploying Fargate clusters in multiple regions and make this a
190
+
real distributed load test simulation. For this, I have created a separate CloudFormation template for you to launch the
191
+
solution in additional regions. The difference between this template and the Master one, is that this one doesn't
192
+
create the ECR Docker Registry and the IAM Execution Role, as you can share these resources across all Fargate deployments.
193
+
194
+
Use the following buttons to launch the solution in the desired additional regions:
195
+
196
+
Additional Region | Region Code | Launch
197
+
------|-----|-----
198
+
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
199
+
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
200
+
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
0 commit comments