Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure "ulimits" for a Docker container running in AWS ECS?

My Java application appears to be running out of "open files" limit when running in a Docker container in AWS ECS. Upon further investigation, I found that the open files limit defaults to 1024.

Typically, in Linux I would edit /etc/security/limits.conf. That does not appear to take effect when I modify that file in my Docker container.

I know I can also pass command line ulimit parameters to docker run as documented here. But I do not have direct access to the Docker command line in ECS. There's gotta be a way to do it via a Task definition. How do I accomplish this ?

like image 474
Oleg Dulin Avatar asked May 13 '16 12:05

Oleg Dulin


People also ask

How do ECS communicate between containers?

The link parameter allows containers to communicate with each other without the need for port mappings. Only supported if the network mode of a task definition is set to bridge. The name:internalName construct is analogous to name:alias in Docker links.

What does the memory parameter under container definition do?

This parameter maps to MemoryReservation in the Create a container section of the Docker Remote API and the --memory-reservation option to docker run . If a task-level memory value is not specified, you must specify a non-zero integer for one or both of memory or memoryReservation in a container definition.


1 Answers

ECS task definition JSON allows you to set ulimits. The Ulimits on ecs task definition correspond to Ulimits in docker run.

Please refer to the following page for more information: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

like image 158
Shibashis Avatar answered Oct 31 '22 17:10

Shibashis