https://github.com/qainsights/terraform-aws-jmeter-distributed-load-test-infra
JMeter Distributed Load Testing Infrastructure on AWS using Terraform
https://github.com/qainsights/terraform-aws-jmeter-distributed-load-test-infra
devops jmeter performance-engineering performance-testing terraform terraform-aws terraform-module
Last synced: 3 months ago
JSON representation
JMeter Distributed Load Testing Infrastructure on AWS using Terraform
- Host: GitHub
- URL: https://github.com/qainsights/terraform-aws-jmeter-distributed-load-test-infra
- Owner: QAInsights
- Created: 2022-02-07T03:14:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-07T03:35:09.000Z (over 3 years ago)
- Last Synced: 2025-04-14T16:17:26.069Z (3 months ago)
- Topics: devops, jmeter, performance-engineering, performance-testing, terraform, terraform-aws, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/QAInsights/jmeter-distributed-load-test-infra/aws/latest
- Size: 7.81 KB
- Stars: 5
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Security: security-group.tf
Awesome Lists containing this project
README
# JMeter Distributed Load Testing Infrastructure on AWS using Terraform
This repo will help you to spin up an AWS EC2 instances with Java, JMeter, and JMeter Plugins for distributed load testing.
## Prerequisites
* Terraform
* AWS Console w/ IAM role## Setup
### AWS Key Pair
* Log into AWS console
* Navigate to EC2 -> Key Pairs
* Create a new key pair w/ RSA and Private Key format (PEM)
* Save the private key to a file in a secure location## Usage
```hcl
module "jmeter-distributed-load-test-infra" {
source = "QAInsights/jmeter-distributed-load-test-infra/aws"# insert the required variables here
aws_ami = "ami-001089eb624938d9f"
aws_key_name = "terraform"
jmeter_version = "5.4.3"
jmeter_workers_count = 2
aws_controller_instance_type = "t2.small"
aws_worker_instance_type = "t2.small"
jmeter_plugins = ["jpgc-casutg"]
}
```By default, it will spin up an `t2.small` [not a free tier] instance with `us-east-2` availability zone. Refer to the [AWS documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-types.html) for more information.
To configure other input variables, refer to the [documentation](https://registry.terraform.io/modules/QAInsights/jmeter/aws/latest?tab=inputs#optional-inputs).
To configure [outputs](outputs.tf), refer to the [documentation](https://registry.terraform.io/modules/QAInsights/jmeter/aws/latest?tab=outputs).
## Terraform Plan and Apply
* Run `terraform init`
* Run `terraform plan`
* Run `terraform apply` when prompted to continue, enter `yes` to spin up the instance## JMeter Execution
* Collect all the IP addresses of the JMeter controller and workers. Create `outputs.tf` to store the IP addresses.
* SSH into the JMeter controller and run the following command to start JMeter:```sh
jmeter -n -t apache-jmeter-5.4.3/bin/examples/CSVSample.jmx -R \
-l run1.log -Dserver.rmi.ssl.disable=true
```## JMeter validation
ssh into the instance using the PEM and run `jmeter -v` to verify JMeter is installed and working.
## Reference
* [Terraform](https://www.terraform.io/)
* [AWS](http://aws.amazon.com/)
* [Apache JMeter](https://jmeter.apache.org/)