Skip to content

Commit 11c29dd

Browse files
Merge pull request #297 from overmindtech/feature/memory-optimization-cost-savings
Feature/memory optimization cost savings
2 parents da1b9b0 + 0c200f6 commit 11c29dd

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

modules/scenarios/memory-optimization/ecs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ resource "aws_iam_role" "ecs_task_role" {
7171
resource "aws_cloudwatch_log_group" "app" {
7272
count = var.enabled ? 1 : 0
7373
name = "/ecs/${local.name_prefix}"
74-
retention_in_days = 7
74+
retention_in_days = 1 # Reduced from 7 days for cost optimization
7575

7676
tags = merge(local.common_tags, {
7777
Name = "${local.name_prefix}-logs"

modules/scenarios/memory-optimization/monitoring.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resource "aws_cloudwatch_metric_alarm" "high_memory_utilization" {
2222
evaluation_periods = "2"
2323
metric_name = "MemoryUtilization"
2424
namespace = "AWS/ECS"
25-
period = "300"
25+
period = "300" # 5 minutes for cost optimization
2626
statistic = "Average"
2727
threshold = "80"
2828
alarm_description = "This metric monitors ECS memory utilization - WILL FIRE when containers run out of memory"

modules/scenarios/memory-optimization/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ variable "java_heap_size_mb" {
8282
variable "enable_container_insights" {
8383
description = "Enable CloudWatch Container Insights for the ECS cluster"
8484
type = bool
85-
default = true
85+
default = false # Disabled for cost optimization
8686
}
8787

8888
variable "health_check_grace_period" {
@@ -106,7 +106,7 @@ variable "application_port" {
106106
variable "cpu_units" {
107107
description = "CPU units for ECS task (1024 = 1 vCPU)"
108108
type = number
109-
default = 1024
109+
default = 512 # Reduced from 1024 for cost savings
110110
}
111111

112112
# Tags

modules/scenarios/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ variable "example_env" {
99
variable "enable_memory_optimization_demo" {
1010
description = "Enable the memory optimization demo scenario"
1111
type = bool
12-
default = false
12+
default = true # Enable demo infrastructure
1313
}
1414

1515
variable "memory_optimization_container_memory" {
1616
description = "Memory allocation for containers in the demo (2048 = safe, 1024 = breaks)"
1717
type = number
18-
default = 2048
18+
default = 1024 # Reduced from 2048MB to save costs
1919
}
2020

2121
variable "memory_optimization_container_count" {
2222
description = "Number of containers to run in the memory optimization demo"
2323
type = number
24-
default = 15
24+
default = 3 # Reduced from 15 to 3 for cost optimization
2525
}
2626

2727
variable "days_until_black_friday" {

0 commit comments

Comments
 (0)