diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 098c088b124..595f8970645 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -8,6 +8,10 @@ on: required: false type: boolean default: false + standaloneInstanceSize: + description: 'AWS instance size of standalone APM Server, e.g. c6i.2xlarge' + required: false + type: string enableTailSampling: description: 'Enable tail-based sampling on the APM server' required: false @@ -67,6 +71,7 @@ jobs: TF_VAR_private_key: ./id_rsa_terraform TF_VAR_public_key: ./id_rsa_terraform.pub TF_VAR_run_standalone: ${{ inputs.runStandalone || github.event.schedule=='0 0 1 * *' }} + TF_VAR_standalone_apm_server_instance_size: ${{ inputs.standaloneInstanceSize || 'c6i.2xlarge' }} TF_VAR_apm_server_tail_sampling: ${{ inputs.enableTailSampling || 'false' }} # set the default again otherwise schedules won't work TF_VAR_apm_server_tail_sampling_storage_limit: ${{ inputs.tailSamplingStorageLimit || '10GB' }} # set the default again otherwise schedules won't work RUN_STANDALONE: ${{ inputs.runStandalone || github.event.schedule=='0 0 1 * *' }} diff --git a/testing/benchmark/main.tf b/testing/benchmark/main.tf index 713eb4725db..02f095fc13a 100644 --- a/testing/benchmark/main.tf +++ b/testing/benchmark/main.tf @@ -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 diff --git a/testing/benchmark/variables.tf b/testing/benchmark/variables.tf index 25671ad3253..8a9aac45235 100644 --- a/testing/benchmark/variables.tf +++ b/testing/benchmark/variables.tf @@ -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" { diff --git a/testing/infra/terraform/modules/standalone_apm_server/main.tf b/testing/infra/terraform/modules/standalone_apm_server/main.tf index 86f08555be7..b05f7f53006 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/main.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/main.tf @@ -172,6 +172,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 { @@ -181,6 +182,16 @@ 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", + ] : [] + } + provisioner "file" { source = "${var.apm_server_bin_path}/apm-server" destination = local.bin_path diff --git a/testing/infra/terraform/modules/standalone_apm_server/variables.tf b/testing/infra/terraform/modules/standalone_apm_server/variables.tf index 69c7a739bd0..38638b02caa 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/variables.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/variables.tf @@ -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