Bobcares

High Memory Utilization for Amazon ECS Tasks on Fargate

by | Aug 20, 2021

Let us discuss how to monitor High Memory Utilization for Amazon ECS Tasks on Fargate.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see effective methods our Support Techs employ to monitor high memory utilization.

 

High Memory Utilization for Amazon ECS Tasks on Fargate

Moving ahead, let us see a few options our Support Techs employ to monitor high memory utilization on the Amazon ECS tasks on Fargate.

 

  • View Amazon CloudWatch metrics

We can view Amazon CloudWatch metrics in either the Amazon ECS console or CloudWatch console.

 

  • Enable CloudWatch logs for your Fargate tasks

1. Initially, we enable the awslogs log driver.

2. Then we add the required log configuration parameters to the task definition.

3. Give the Amazon ECS task execution for the AWS IAM role the permissions to send logs to Amazon CloudWatch Logs.

4. After that we view the logs in the CloudWatch console.

 

  • Use Container Insights to monitor memory utilization

With CloudWatch Container Insights we can monitor memory utilization for each container in a Fargate task.

1. Initially, we open the CloudWatch console.

2. From the navigation pane, in the Container Insights section, we select Resources.

3. We get more information about a resource if we select the name of the resource.

4. Then we select the name of the task definition that we want more information about.

5. After that, we go to the Container Performance section > Actions > View performance logs.

This opens CloudWatch Logs Insights for the ECS cluster.

6. Later in the query box, we enter the following query, and then select Run query:

stats avg(MemoryUtilized) by bin (30m) as period, TaskDefinitionFamily, TaskDefinitionRevision
| filter Type = "Task" | sort period desc, TaskDefinitionFamily | limit 10

 

  • Use Container Insights to set an alarm on high memory utilization

1. Initially, we open the CloudWatch console.

2. Then from the navigation pane, in the Container Insights section, we select Performance Monitoring.

3. After that, from the dropdown menu, we select ECS Tasks or ECS Services.

4. On the Memory Utilization card, we expand and then select View in Metrics.

5. From the Graphed metrics tab, we can select the bell icon in the Actions column for the task that we want more information about.

6. On the Specify metric and conditions page, we select the desired values or leave the default values.

7. In the Conditions section, for Define the threshold value, we enter 70 to sets the alarm’s memory utilization threshold to 70%.

8. Eventually, we select Next.

9. Then on the Configure actions page, in the Select an SNS topic section, we select Create a new topic.

10. For Send a notification to, we enter the email ID where we want the alarm notifications sent.

11. Eventually, we select Next.

12. On the Add name and description page, we enter a name for the alarm and description if necessary.

13. Then we select Next > Create alarm.

14. Finally, we will receive an email from AWS. By following the information in it, we can confirm the subscription.

[Need help with procedures? We are here for you]

 

Conclusion

In short, we saw how our Support Techs go about memory utilization.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.