Skip to content

Commit

Permalink
Example of usage with Taurus BZT (#13)
Browse files Browse the repository at this point in the history
# Taurus Basic Configuration
    
In its basic use it is necessary to provide information about which network will be used, where are your test plan scripts and finally define the number of nodes needed to carry out the desired load.

```hcl
module "loadtest" {

    source = "../../"

    name = "nome-da-implantacao-taurus"
    executor = "bzt"
    loadtest_dir_source = "../plan/"
    loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" taurus/*.yml"
    nodes_size = 2

    subnet_id = data.aws_subnet.current.id
}

data "aws_subnet" "current" {
    filter {
        name   = "tag:Name"
        values = ["subnet-prd-a"]
    }
}
```

---
  • Loading branch information
marcosborges authored Nov 8, 2021
1 parent cfbbc57 commit 2d8e4ee
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 61 deletions.
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ This module proposes a simple and uncomplicated way to run your load tests creat
## Basic usage with JMeter

```hcl
module "loadtest" {
module "loadtest-distribuited" {
source = "marcosborges/loadtest-distribuited/aws"
name = "nome-da-implantacao"
executor = "jmeter"
loadtest_dir_source = "./assets"
loadtest_entrypoint = "jmeter -n -t jmeter/basic.jmx -R \"{NODES_IPS}\" *.jmx"
loadtest_dir_source = "examples/plan/"
nodes_size = 2
loadtest_entrypoint = "jmeter -n -t jmeter/basic.jmx -R \"{NODES_IPS}\" -l /var/logs/loadtest -e -o /var/www/html -Dnashorn.args=--no-deprecation-warning -Dserver.rmi.ssl.disable=true "
subnet_id = data.aws_subnet.current.id
}
Expand All @@ -35,24 +36,23 @@ data "aws_subnet" "current" {

![bp](https://github.com/marcosborges/terraform-aws-loadtest-distribuited/raw/master/assets/jmeter-dashboard.png)



---

## Basic usage with Taurus

In its basic use it is necessary to provide information about which network will be used, where are your test plan scripts and finally define the number of nodes needed to carry out the desired load.

```hcl
module "loadtest" {
module "loadtest-distribuited" {
source = "marcosborges/loadtest-distribuited/aws"
name = "nome-da-implantacao"
executor = "bzt"
loadtest_dir_source = "./load-test-plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
executor = "jmeter"
loadtest_dir_source = "examples/plan/"
nodes_size = 2
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" taurus/basic.yml"
subnet_id = data.aws_subnet.current.id
}
Expand Down Expand Up @@ -84,22 +84,25 @@ The module also provides advanced settings.
```hcl
module "loadtest" {
source = "marcosborges/loadtest-distribuited/aws"
subnet_id = data.aws_subnet.current.id
name = "nome-da-implantacao"
executor = "bzt"
loadtest_dir_source = "./assets"
loadtest_dir_source = "examples/plan/"
loadtest_dir_destination = "/loadtest"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" taurus/basic.yml"
nodes_size = 3
subnet_id = data.aws_subnet.current.id
#AUTO SPLIT
split_data_mass_between_nodes = {
enable = true
data_mass_filenames = [
"../plan/data/data.csv"
"data/users.csv"
]
}
Expand Down Expand Up @@ -179,16 +182,22 @@ data "aws_ami" "my_image" {
}
```

---

## Sugestion

## Defaults

**Instance type:** https://aws.amazon.com/pt/ec2/instance-types/c5/

The [C5](https://aws.amazon.com/pt/ec2/instance-types/c5/) family of instances is a good choice for the load test.


|Model|vCPU|Mem (GiB)|Storage (GiB)|Network Band. (Gbps)|
|:---:|:---:|:---:|:---:|:---:|
|c5n.large| 2 | 5.25 | EBS | 25 -> 4.750|
|c5n.xlarge| 4 | 10.5 | EBS | 25 -> 4.750|
|c5n.2xlarge| 8 | 21 | EBS | 25 -> 4.750|
|c5n.4xlarge| 16 | 42 | EBS | 25 4.750|
|c5n.9xlarge| 36 | 96 | EBS | 50 9.500|
|c5n.18xlarge| 72 | 192 | EBS | 100 19.000|
|c5n.metal| 72 | 192 | EBS | 100 19.000|

---

Expand Down
2 changes: 1 addition & 1 deletion examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "loadtest-distribuited" {
source = "../../"
#source = "marcosborges/loadtest-distribuited/aws"
name = "nome-da-implantacao"
name = "nome-da-implantacao-basic"
executor = "jmeter"
loadtest_dir_source = "../plan/"
nodes_size = 2
Expand Down
3 changes: 1 addition & 2 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ module "loadtest" {

source = "../../"
#source = "marcosborges/loadtest-distribuited/aws"
#version = "1.0.0"

name = "nome-da-implantacao"
name = "nome-da-implantacao-basic"
executor = var.executor #"jmeter"
loadtest_dir_source = "../plan/"
nodes_size = 2
Expand Down
45 changes: 32 additions & 13 deletions examples/plan/taurus/basic.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
execution:
- concurrency: 10
ramp-up: 1m
hold-for: 5m
scenario: quick-test
- concurrency: 10
ramp-up: 1m
hold-for: 5m
scenario: quick-test

scenarios:
quick-test:
#data-sources:
# - path: /loadtest/data/users.csv
# delimiter: ','
# quoted: true
# encoding: "utf-8"
# loop: true
# variable-names: name,email,password
# random-order: false
requests:

- label: Google
url: https://google.com

- label: Microsoft
url: https://microsoft.com

- label: Facebook
url: https://facebook.com
- label: Google
url: https://google.com
- label: Microsoft
url: https://microsoft.com
- label: Facebook
url: https://facebook.com
properties:
server.rmi.ssl.disable: true

modules:
jmeter:
gui: false
version: 5.4.1
properties:
mode: StrippedBatch
memory-xmx: 10G
cmdline: -l /loadtest/logs -e -o /var/www/html/taurus

settings:
verbose: false
2 changes: 1 addition & 1 deletion examples/split-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module "loadtest" {
source = "marcosborges/loadtest-distribuited/aws"
name = "nome-da-implantacao"
name = "nome-da-implantacao-spliter"
executor = "jmeter"
loadtest_dir_source = "../plan/"
nodes_size = 2
Expand Down
2 changes: 1 addition & 1 deletion examples/split-data/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module "loadtest" {
source = "../../"
#source = "marcosborges/loadtest-distribuited/aws"

name = "nome-da-implantacao"
name = "nome-da-implantacao-spliter"
executor = "jmeter"
loadtest_dir_source = "../plan/"
nodes_size = 2
Expand Down
12 changes: 6 additions & 6 deletions examples/taurus/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Basic Config:
# Taurus Basic Configuration

In its basic use it is necessary to provide information about which network will be used, where are your test plan scripts and finally define the number of nodes needed to carry out the desired load.

Expand All @@ -7,11 +7,11 @@ module "loadtest" {
source = "../../"
name = "nome-da-implantacao"
executor = "jmeter"
loadtest_dir_source = "../plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
nodes_size = 3
name = "nome-da-implantacao-taurus"
executor = "bzt"
loadtest_dir_source = "../plan/"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" taurus/*.yml"
nodes_size = 2
subnet_id = data.aws_subnet.current.id
}
Expand Down
15 changes: 6 additions & 9 deletions examples/taurus/main.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
provider "aws" {
region = "us-east-1"
}

module "loadtest" {

source = "../../"

name = "nome-da-implantacao"
executor = "jmeter"
loadtest_dir_source = "../plan"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml"
nodes_size = 3
name = "nome-da-implantacao-taurus"
executor = "bzt"
loadtest_dir_source = "../plan/"
loadtest_entrypoint = "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" taurus/*.yml"
nodes_size = 2

subnet_id = data.aws_subnet.current.id
ssh_export_pem = false
}

data "aws_subnet" "current" {
Expand Down
1 change: 1 addition & 0 deletions executor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ resource "null_resource" "executor" {
provisioner "remote-exec" {
inline = [
"echo DIR: ${var.loadtest_dir_destination}",
"ls -lah ${var.loadtest_dir_destination}",
"cd ${var.loadtest_dir_destination}",
"echo ${local.entrypoint}",
local.entrypoint
Expand Down
6 changes: 0 additions & 6 deletions leader.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,3 @@ resource "aws_instance" "leader" {
}
)
}


resource "null_resource" "push_key_pair_to_leader" {


}
2 changes: 1 addition & 1 deletion slipter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ locals {

# JOIN COMMANDS TO BE EXECUTED BY LEADER
leader_cmds = concat(
["echo AUTO SPLITER"],
local.leader_split_cmds,
local.leader_ssh_nodes_cleanup_cmds,
local.leader_scp_cmds
)
}


resource "null_resource" "spliter_execute_command" {

# CONNECT TO LEADER
Expand Down

0 comments on commit 2d8e4ee

Please sign in to comment.