Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf: add standalone apm server profiles with NVMe SSDs and io2 EBS #15624

Merged
merged 10 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions testing/benchmark/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module "standalone_apm_server" {
apm_instance_type = var.standalone_apm_server_instance_size
apm_volume_type = var.standalone_apm_server_volume_type
apm_volume_size = var.apm_server_tail_sampling ? coalesce(var.standalone_apm_server_volume_size, 60) : var.standalone_apm_server_volume_size
apm_iops = var.standalone_apm_server_iops
apm_server_bin_path = var.apm_server_bin_path
ea_managed = false

Expand Down
23 changes: 23 additions & 0 deletions testing/benchmark/system-profiles/16GB_NVMe-x2zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.2xlarge"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "128g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "16g"
# Number of shards for the ES indices
apm_shards = 4

# Standalone

standalone_apm_server_instance_size = "c6id.2xlarge"
standalone_moxy_instance_size = "c6i.4xlarge"
21 changes: 21 additions & 0 deletions testing/benchmark/system-profiles/1GB_NVMe-x1zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.large"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "16g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "1g"

# Standalone

standalone_apm_server_instance_size = "c6id.large"
standalone_moxy_instance_size = "c6i.xlarge"
21 changes: 21 additions & 0 deletions testing/benchmark/system-profiles/2GB_NVMe-x1zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.large"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "16g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "2g"

# Standalone

standalone_apm_server_instance_size = "c6id.large"
standalone_moxy_instance_size = "c6i.xlarge"
25 changes: 25 additions & 0 deletions testing/benchmark/system-profiles/32GB_NVMe-x2zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.4xlarge"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "256g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# Run the cluster with a dedicated master
elasticsearch_dedicated_masters = true
# APM server instance size
apm_server_size = "32g"
# Number of shards for the ES indices
apm_shards = 4

# Standalone

standalone_apm_server_instance_size = "c6id.4xlarge"
standalone_moxy_instance_size = "c6i.8xlarge"
2 changes: 1 addition & 1 deletion testing/benchmark/system-profiles/32GBx2zone.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ user_name = "USER"

# APM bench

worker_instance_type = "c6i.2xlarge"
worker_instance_type = "c6i.4xlarge"

# Elastic Cloud

Expand Down
21 changes: 21 additions & 0 deletions testing/benchmark/system-profiles/4GB_NVMe-x1zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.large"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "32g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "4g"

# Standalone

standalone_apm_server_instance_size = "c6id.large"
standalone_moxy_instance_size = "c6i.xlarge"
21 changes: 21 additions & 0 deletions testing/benchmark/system-profiles/8GB_NVMe-x1zone.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.xlarge"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "64g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "8g"

# Standalone

standalone_apm_server_instance_size = "c6id.xlarge"
standalone_moxy_instance_size = "c6i.2xlarge"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
user_name = "USER"

# APM bench

worker_instance_type = "c6i.xlarge"

# Elastic Cloud

# The number of AZs the APM Server should span.
apm_server_zone_count = 1
# The Elasticsearch cluster node size.
elasticsearch_size = "64g"
# The number of AZs the Elasticsearch cluster should have.
elasticsearch_zone_count = 2
# APM server instance size
apm_server_size = "8g"

# Standalone

standalone_apm_server_instance_size = "c6i.xlarge"
standalone_apm_server_volume_type = "io2"
standalone_apm_server_iops = 6000
standalone_moxy_instance_size = "c6i.2xlarge"
6 changes: 6 additions & 0 deletions testing/benchmark/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ variable "standalone_apm_server_volume_size" {
description = "Optional volume size in GB to use for APM Server VM"
}

variable "standalone_apm_server_iops" {
default = null
type = number
description = "Optional disk IOPS in GB to use for APM Server VM"
}

## VPC Network settings

variable "vpc_cidr" {
Expand Down
13 changes: 13 additions & 0 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ resource "aws_instance" "apm" {
root_block_device {
volume_type = var.apm_volume_type
volume_size = var.apm_volume_size
iops = var.apm_iops
}

connection {
Expand All @@ -159,6 +160,18 @@ resource "aws_instance" "apm" {
private_key = file("${var.aws_provisioner_key_name}")
}

// For instance types with 'd.' e.g. c6id.2xlarge, use the NVMe ssd as data disk.
provisioner "remote-exec" {
inline = length(regexall("d[.]", self.instance_type)) > 0 ? [
"sudo mkfs -t xfs /dev/nvme1n1",
"mkdir ~/data",
"sudo mount /dev/nvme1n1 ~/data",
"sudo chown $USER:$USER ~/data",
] : [
":", // no-op
]
}

provisioner "file" {
source = "${var.apm_server_bin_path}/apm-server"
destination = local.bin_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ variable "apm_volume_size" {
description = "Optional apm server volume size in GB override"
}

variable "apm_iops" {
default = null
type = number
description = "Optional apm server disk IOPS override"
}

variable "vpc_id" {
description = "VPC ID to provision the EC2 instance"
type = string
Expand Down