Skip to content

Commit cc6e47d

Browse files
tf: add standalone apm server profiles with NVMe SSDs and io2 EBS (#15624) (#15656)
Improve benchmarking tf setup to facilitate benchmarking on standalone apm server setup with faster disks (e.g. local NVMe SSD) - Add NVMe c6id ec2 instance profiles - Use NVMe disk for data directory for instance types with d., e.g. c6id.2xlarge - Configurable disk IOPS which is a required field for io2 volume type - Bigger worker instance for 32GB profile to avoid OOM (cherry picked from commit 3afe1fd) Co-authored-by: Carson Ip <[email protected]>
1 parent 76c8cf5 commit cc6e47d

12 files changed

+182
-1
lines changed

testing/benchmark/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ module "standalone_apm_server" {
157157
apm_instance_type = var.standalone_apm_server_instance_size
158158
apm_volume_type = var.standalone_apm_server_volume_type
159159
apm_volume_size = var.apm_server_tail_sampling ? coalesce(var.standalone_apm_server_volume_size, 60) : var.standalone_apm_server_volume_size
160+
apm_iops = var.standalone_apm_server_iops
160161
apm_server_bin_path = var.apm_server_bin_path
161162
ea_managed = false
162163

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.2xlarge"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "128g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "16g"
17+
# Number of shards for the ES indices
18+
apm_shards = 4
19+
20+
# Standalone
21+
22+
standalone_apm_server_instance_size = "c6id.2xlarge"
23+
standalone_moxy_instance_size = "c6i.4xlarge"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.large"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "16g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "1g"
17+
18+
# Standalone
19+
20+
standalone_apm_server_instance_size = "c6id.large"
21+
standalone_moxy_instance_size = "c6i.xlarge"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.large"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "16g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "2g"
17+
18+
# Standalone
19+
20+
standalone_apm_server_instance_size = "c6id.large"
21+
standalone_moxy_instance_size = "c6i.xlarge"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.4xlarge"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "256g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# Run the cluster with a dedicated master
16+
elasticsearch_dedicated_masters = true
17+
# APM server instance size
18+
apm_server_size = "32g"
19+
# Number of shards for the ES indices
20+
apm_shards = 4
21+
22+
# Standalone
23+
24+
standalone_apm_server_instance_size = "c6id.4xlarge"
25+
standalone_moxy_instance_size = "c6i.8xlarge"

testing/benchmark/system-profiles/32GBx2zone.tfvars

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ user_name = "USER"
22

33
# APM bench
44

5-
worker_instance_type = "c6i.2xlarge"
5+
worker_instance_type = "c6i.4xlarge"
66

77
# Elastic Cloud
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.large"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "32g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "4g"
17+
18+
# Standalone
19+
20+
standalone_apm_server_instance_size = "c6id.large"
21+
standalone_moxy_instance_size = "c6i.xlarge"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.xlarge"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "64g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "8g"
17+
18+
# Standalone
19+
20+
standalone_apm_server_instance_size = "c6id.xlarge"
21+
standalone_moxy_instance_size = "c6i.2xlarge"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
user_name = "USER"
2+
3+
# APM bench
4+
5+
worker_instance_type = "c6i.xlarge"
6+
7+
# Elastic Cloud
8+
9+
# The number of AZs the APM Server should span.
10+
apm_server_zone_count = 1
11+
# The Elasticsearch cluster node size.
12+
elasticsearch_size = "64g"
13+
# The number of AZs the Elasticsearch cluster should have.
14+
elasticsearch_zone_count = 2
15+
# APM server instance size
16+
apm_server_size = "8g"
17+
18+
# Standalone
19+
20+
standalone_apm_server_instance_size = "c6i.xlarge"
21+
standalone_apm_server_volume_type = "io2"
22+
standalone_apm_server_iops = 6000
23+
standalone_moxy_instance_size = "c6i.2xlarge"

testing/benchmark/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ variable "standalone_apm_server_volume_size" {
142142
description = "Optional volume size in GB to use for APM Server VM"
143143
}
144144

145+
variable "standalone_apm_server_iops" {
146+
default = null
147+
type = number
148+
description = "Optional disk IOPS in GB to use for APM Server VM"
149+
}
150+
145151
## VPC Network settings
146152

147153
variable "vpc_cidr" {

testing/infra/terraform/modules/standalone_apm_server/main.tf

+13
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ resource "aws_instance" "apm" {
172172
root_block_device {
173173
volume_type = var.apm_volume_type
174174
volume_size = var.apm_volume_size
175+
iops = var.apm_iops
175176
}
176177

177178
connection {
@@ -181,6 +182,18 @@ resource "aws_instance" "apm" {
181182
private_key = file("${var.aws_provisioner_key_name}")
182183
}
183184

185+
// For instance types with 'd.' e.g. c6id.2xlarge, use the NVMe ssd as data disk.
186+
provisioner "remote-exec" {
187+
inline = length(regexall("d[.]", self.instance_type)) > 0 ? [
188+
"sudo mkfs -t xfs /dev/nvme1n1",
189+
"mkdir ~/data",
190+
"sudo mount /dev/nvme1n1 ~/data",
191+
"sudo chown $USER:$USER ~/data",
192+
] : [
193+
":", // no-op
194+
]
195+
}
196+
184197
provisioner "file" {
185198
source = "${var.apm_server_bin_path}/apm-server"
186199
destination = local.bin_path

testing/infra/terraform/modules/standalone_apm_server/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ variable "apm_volume_size" {
2222
description = "Optional apm server volume size in GB override"
2323
}
2424

25+
variable "apm_iops" {
26+
default = null
27+
type = number
28+
description = "Optional apm server disk IOPS override"
29+
}
30+
2531
variable "vpc_id" {
2632
description = "VPC ID to provision the EC2 instance"
2733
type = string

0 commit comments

Comments
 (0)