1

We are using alpine image on AWS ecs which work fine on just 100mb memory in task definition. Now we need ubuntu image which size is more then 180mb while alpine is just 5mb.

  • I want to know that we need to increase memory according to image?

  • or Docker image run completely in memory or just current processes in memory what if I specify memory less then docker image size in task definition?

AWS recommend 300 to 500mb but in development I want to save memory.

Thanks

1
  • It's a little confusing what do you actually mean by "memory", usually it is RAM size, but you specify image size, which consumes disk space, but not RAM. So if you mean memory as RAM, then alpine and ubuntu will consume similar amount of RAM if they run similar application.
    – oryades
    Aug 21, 2017 at 8:21

1 Answer 1

2

There are two important parameters that you can use wisely to deal with AWS ECS task definition.

memory:

The hard limit (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed.

memoryReservation:

Docker attempts to keep the container memory to this soft limit; however, your container can consume more memory when it needs to.

I recommend you to go with memoryReservation. So your task definition will look like this.

{
  "family": "my-alpine",
  "networkMode": "bridge",
  "containerDefinitions": [
    {
      "image": "alpine:latest",
      "name": "my-alpine",
      "memoryReservation": 100,
      ...
      ...
    }
  ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.