From 2306c56ff34ce61d69fefb3c5ae5cb8b9cf7a50c Mon Sep 17 00:00:00 2001 From: decfox Date: Thu, 20 Nov 2025 18:14:30 +0530 Subject: [PATCH 1/3] feat: vertically scale cluster machine; reduce overall ec2 count --- tf/environments/prod/main.tf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tf/environments/prod/main.tf b/tf/environments/prod/main.tf index 0e3e1f15..227587b8 100644 --- a/tf/environments/prod/main.tf +++ b/tf/environments/prod/main.tf @@ -521,11 +521,11 @@ module "ooniapi_cluster" { subnet_ids = module.network.vpc_subnet_public[*].id # You need be careful how these are tweaked. - asg_min = 2 - asg_max = 10 - asg_desired = 7 + asg_min = 1 + asg_max = 5 + asg_desired = 4 - instance_type = "t3a.medium" + instance_type = "t3a.large" monitoring_sg_ids = [ # The clickhouse proxy has an nginx configuration @@ -550,11 +550,11 @@ module "oonitier1plus_cluster" { vpc_id = module.network.vpc_id subnet_ids = module.network.vpc_subnet_private[*].id - asg_min = 2 - asg_max = 5 - asg_desired = 3 + asg_min = 1 + asg_max = 4 + asg_desired = 2 - instance_type = "t3a.medium" + instance_type = "t3a.large" monitoring_sg_ids = [ # The clickhouse proxy has an nginx configuration From 77ae1f162e5591a4dcd2e22413b7b8256c71ed5a Mon Sep 17 00:00:00 2001 From: decfox Date: Thu, 20 Nov 2025 18:38:23 +0530 Subject: [PATCH 2/3] chore: also decrease service desired count for ooniprobe service --- tf/environments/prod/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tf/environments/prod/main.tf b/tf/environments/prod/main.tf index 227587b8..b5d97781 100644 --- a/tf/environments/prod/main.tf +++ b/tf/environments/prod/main.tf @@ -624,9 +624,9 @@ module "ooniapi_ooniprobe" { dns_zone_ooni_io = local.dns_zone_ooni_io key_name = module.adm_iam_roles.oonidevops_key_name ecs_cluster_id = module.ooniapi_cluster.cluster_id - task_memory = 128 + task_memory = 512 - service_desired_count = 8 + service_desired_count = 2 task_secrets = { POSTGRESQL_URL = data.aws_ssm_parameter.oonipg_url.arn From f0c0a6102eaee3d5e0a2b2f0710a45706d3eb501 Mon Sep 17 00:00:00 2001 From: decfox Date: Thu, 20 Nov 2025 18:44:31 +0530 Subject: [PATCH 3/3] feat: increase oonimeasurements memory reserve; decrease task count --- tf/environments/prod/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tf/environments/prod/main.tf b/tf/environments/prod/main.tf index b5d97781..e122d727 100644 --- a/tf/environments/prod/main.tf +++ b/tf/environments/prod/main.tf @@ -933,7 +933,7 @@ module "ooniapi_oonimeasurements_deployer" { module "ooniapi_oonimeasurements" { source = "../../modules/ooniapi_service" - task_memory = 256 + task_memory = 512 first_run = true vpc_id = module.network.vpc_id @@ -946,7 +946,7 @@ module "ooniapi_oonimeasurements" { ecs_cluster_id = module.oonitier1plus_cluster.cluster_id # ecs_cluster_id = module.ooniapi_cluster.cluster_id - service_desired_count = 8 + service_desired_count = 4 task_secrets = { POSTGRESQL_URL = data.aws_ssm_parameter.oonipg_url.arn