Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public class GKEConfig {
@Expose
private String nodeLocations;

@SerializedName(value = "jvm_args", alternate = "jvmArgs")
@Expose
private String jvmArgs;

@SerializedName(value = "min_count", alternate = "minCount")
@Expose
private int minCount;
Expand Down Expand Up @@ -153,6 +157,14 @@ public void setNodeLocations(String nodeLocations) {
this.nodeLocations = nodeLocations;
}

public String getJvmArgs() {
return jvmArgs;
}

public void setJvmArgs(String jvmArgs) {
this.jvmArgs = jvmArgs;
}

public int getMinCount() {
return minCount;
}
Expand Down
20 changes: 10 additions & 10 deletions machmeter/src/main/resources/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ variable "gke_config" {
service_account_json = string
machine_type = string
node_locations = string
jvm_args = string
min_count = number
max_count = number
initial_node_count = number
Expand Down Expand Up @@ -303,6 +304,10 @@ resource "kubernetes_deployment" "jmeter-master" {
name = "GOOGLE_APPLICATION_CREDENTIALS"
value = "/var/secrets/google/key.json"
}
env {
name = "JVM_ARGS"
value: var.gke_config.jvm_args
}
}
volume {
name = "loadtest"
Expand Down Expand Up @@ -367,19 +372,14 @@ resource "kubernetes_stateful_set" "jmeter-slave" {
port {
container_port = 50000
}
resources {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing these resources, this would mean pod can take max availabe resources on a node. Instead we should have keep these values as default and have an option to override these from setup.json .

Copy link
Collaborator Author

@rahul2393 rahul2393 Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recently we have seen people trying with lesser configuration node in which case if we go with the values as default Machmeter will through Unschedule errors, can you think of any scenario where we don't want the pods to use all the available resources on node?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case what we can do is have a smaller value for requests which can be the minimum requirement for running Jmeter and remove the limits section.

Keeping requests will make sure that when pod is getting scheduled it gets minimum resources to run Jmeter.

One can create 1000 slaves, but when they will try to run , it might fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, done

limits = {
cpu = "1000m"
memory = "2Gi"
}
requests = {
cpu = "1000m"
memory = "2Gi"
}
}
env {
name = "GOOGLE_APPLICATION_CREDENTIALS"
value = "/var/secrets/google/key.json"

}
env {
name = "JVM_ARGS"
value: var.gke_config.jvm_args
}
}
volume {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"nodeLocations": "us-central1-a,us-central1-b,us-central1-c",
"minCount": 3,
"maxCount": 3,
"initialNodeCount": 3
"initialNodeCount": 3,
"jvmArgs": "-Xms1g -Xmx1g"
}
},
"ddlConfig" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"nodeLocations": "us-central1-a,us-central1-b,us-central1-c",
"minCount": 3,
"maxCount": 3,
"initialNodeCount": 3
"initialNodeCount": 3,
"jvmArgs": "-Xms1g -Xmx1g"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a default value for jvmArgs in GKEConfig as -Xms1g -Xmx1g and not mention it in setup.json. Only when we want to override we should pass the value . WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
},
"ddlConfig" : {
Expand Down
3 changes: 2 additions & 1 deletion machmeter/usecases/finance/ledger/sample-configs/setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"nodeLocations": "us-central1-a,us-central1-b,us-central1-c",
"minCount": 3,
"maxCount": 3,
"initialNodeCount": 3
"initialNodeCount": 3,
"jvmArgs": "-Xms1g -Xmx1g"
}
},
"ddlConfig" : {
Expand Down
3 changes: 2 additions & 1 deletion machmeter/usecases/shopping/cart/sample-configs/setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"nodeLocations": "us-central1-a,us-central1-b,us-central1-c",
"minCount": 3,
"maxCount": 3,
"initialNodeCount": 3
"initialNodeCount": 3,
"jvmArgs": "-Xms1g -Xmx1g"
}
},
"ddlConfig" : {
Expand Down