Skip to content

Commit

Permalink
Fix memory usage for tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Aug 22, 2023
1 parent 0d3533a commit 25adde4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/client_gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
},
{
"identifier": "client-gateway",
"branch": "master",
"branch": "fix_memory_usage_for_tasks",
"image_tag": "latest",
"ecs_service": "client-gateway",
"ecs_cluster": "somleng-switch"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/media_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
},
{
"identifier": "media-proxy",
"branch": "master",
"branch": "fix_memory_usage_for_tasks",
"image_tag": "latest",
"ecs_service": "media-proxy",
"ecs_cluster": "somleng-switch"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/public_gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
},
{
"identifier": "public-gateway",
"branch": "master",
"branch": "fix_memory_usage_for_tasks",
"image_tag": "latest",
"ecs_service": "public-gateway",
"ecs_cluster": "somleng-switch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ systemctl start amazon-ssm-agent
# ECS config
cat <<'EOF' >> /etc/ecs/ecs.config
ECS_CLUSTER=${cluster_name}
ECS_RESERVED_MEMORY=128
ECS_RESERVED_MEMORY=256
ECS_ENABLE_CONTAINER_METADATA=true
EOF
2 changes: 1 addition & 1 deletion infrastructure/modules/somleng_switch/client_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ resource "aws_ecs_task_definition" "client_gateway" {
requires_compatibilities = ["EC2"]
execution_role_arn = aws_iam_role.client_gateway_task_execution_role.arn
container_definitions = data.template_file.client_gateway.rendered
memory = module.client_gateway_container_instances.ec2_instance_type.memory_size - 256
memory = module.client_gateway_container_instances.ec2_instance_type.memory_size - 512

volume {
name = "opensips"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/somleng_switch/media_proxy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ resource "aws_ecs_task_definition" "media_proxy" {
requires_compatibilities = ["EC2"]
execution_role_arn = aws_iam_role.media_proxy_task_execution_role.arn
container_definitions = data.template_file.media_proxy.rendered
memory = module.media_proxy_container_instances.ec2_instance_type.memory_size - 256
memory = module.media_proxy_container_instances.ec2_instance_type.memory_size - 512
}

resource "aws_ecs_service" "media_proxy" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/somleng_switch/public_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ resource "aws_ecs_task_definition" "public_gateway" {
task_role_arn = aws_iam_role.public_gateway_task_role.arn
execution_role_arn = aws_iam_role.public_gateway_task_execution_role.arn
container_definitions = data.template_file.public_gateway.rendered
memory = module.public_gateway_container_instances.ec2_instance_type.memory_size - 256
memory = module.public_gateway_container_instances.ec2_instance_type.memory_size - 512

volume {
name = "opensips"
Expand Down

0 comments on commit 25adde4

Please sign in to comment.