Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat!(infra): tune macro-db parameter group, update macro-db instance size (#5267)

teo86ef1fca7946
diff --git a/infra/stacks/macrodb/Pulumi.prod.yaml b/infra/stacks/macrodb/Pulumi.prod.yaml
index a7d320903f..1a0ecead1c 100644
--- a/infra/stacks/macrodb/Pulumi.prod.yaml
+++ b/infra/stacks/macrodb/Pulumi.prod.yaml
@@ -3,8 +3,8 @@ config:
macrodb:db_password_secret_key: macrodb-password-prod
macrodb:parameter_group_family_legacy: postgres14
macrodb:parameter_group_family: postgres16
- macrodb:engine_version: 14.17
- macrodb:instance_size: db.t4g.xlarge
+ macrodb:engine_version: 14.22
+ macrodb:instance_size: db.m9g.2xlarge
macrodb:storage_type: gp3
macrodb:storage_iops: 12000
macrodb:storage_throughput: 500
@@ -19,4 +19,4 @@ config:
macrodb:monitoring_interval: 60
macrodb:rds_monitoring_role_arn: arn:aws:iam::569036502058:role/rds-monitoring-role
macrodb:backup_retention_days: 6
- macrodb:read_replica_instance_size: db.t4g.xlarge
+ macrodb:read_replica_instance_size: db.m9g.xlarge
diff --git a/infra/stacks/macrodb/index.ts b/infra/stacks/macrodb/index.ts
index 21ae6e7941..591d8f2e47 100644
--- a/infra/stacks/macrodb/index.ts
+++ b/infra/stacks/macrodb/index.ts
@@ -50,6 +50,15 @@ const originalParameterGroup = new aws.rds.ParameterGroup(
{ name: 'auto_explain.log_nested_statements', value: 'on' },
{ name: 'auto_explain.sample_rate', value: '1' },
{ name: 'idle_in_transaction_session_timeout', value: '300000' },
+ // Tune planner costs and prefetch for gp3 SSD.
+ { name: 'random_page_cost', value: '1.1' },
+ { name: 'effective_io_concurrency', value: '256' },
+ // Reduce sort/hash disk spills; 16MB sized for the smallest (8GiB dev) instance.
+ { name: 'work_mem', value: '16384' },
+ // Avoid JIT startup cost for one-off dynamic Soup queries.
+ { name: 'jit', value: '0' },
+ // Log spills of at least 10MB for follow-up tuning.
+ { name: 'log_temp_files', value: '10240' },
],
tags,
},
@@ -84,6 +93,15 @@ if (stack === 'prod') {
{ name: 'auto_explain.log_nested_statements', value: 'on' },
{ name: 'auto_explain.sample_rate', value: '1' },
{ name: 'idle_in_transaction_session_timeout', value: '300000' },
+ // Tune planner costs and prefetch for gp3 SSD.
+ { name: 'random_page_cost', value: '1.1' },
+ { name: 'effective_io_concurrency', value: '256' },
+ // Reduce sort/hash disk spills; 16MB sized for the smallest (8GiB dev) instance.
+ { name: 'work_mem', value: '16384' },
+ // Avoid JIT startup cost for one-off dynamic Soup queries.
+ { name: 'jit', value: '0' },
+ // Log spills of at least 10MB for follow-up tuning.
+ { name: 'log_temp_files', value: '10240' },
],
tags,
},