大网数据广告活动
服务器运维问答

Memory utilisation and OOM exception in AWS ECS

· 52CE 我爱测

Here is a chart of MemoryUtilization from one of my service in an ECS cluster. As you can see the memory shot up to 25% briefly. In this cluster I have 3 t2.medium machines. The specification says these machines have 4GiB RAM. My…

问题原文

原帖链接 · Anthony Kong · CC BY-SA 3.0

Here is a chart of MemoryUtilization from one of my service in an ECS cluster.

As you can see the memory shot up to 25% briefly.

In this cluster I have 3 t2.medium machines. The specification says these machines have 4GiB RAM.

My current issue:

I am running a ImageMagic convert job in my aws ecs task and the process gets killed for converting a big file (exit status 137). However on my local PC the same job can run without any issue.

My aws ecs task is defined to have a hard software limit of 1792MiB. (It is the magic number to run at least two tasks on a t2.medium)

My questions are:

1) How to understand the graph? What is the divisor of the percentage? Total memory of all ec2 instances? Not sure how to make sense of the chart.

2) How can make the memory usage more flexible? Most of the time my convert does not need to consume a lot of RAM. I hope the container can share unused memory.

已采纳解答

原帖链接 · Anthony Kong · CC BY-SA 3.0

It is because I have used hard limit in the task definition. It placed an upper cap on the RAM the container can use and hence caused the convert to fail. Instead I should have used soft limit and set it to a low RAM usage. It will allow the container to use RAM as much as the ec2 instance can provide.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。