0

I am using the AWS EC2 task defintions to run a docker container on a aws ecs cluster. The issue i am having is that i would like to set the vm.nr_hugepages value to 1280 for the host system.

AWS has included to option to add system controls to the task definition thus letting you change certain system values. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols

I have succeeded in adding the system controls to the task definition but AWS returns the following error when i try to create the task.

Unable to create Task Definition The 'systemControls' namespace vm.nr_hugepages must start with ipc prefix 'fs.mqueue.' or network prefix 'net.' or be one of: [kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, kernel.shmmax, kernel.shmmni, kernel.shm_rmid_forced]'. Change the value and try again.

I am not very familiar with the linux kernel settings so i am unsure if i am doing something wrong or if this just not possible, does anyone know?

I am using a custom docker image based on alpine 3.7

1 Answers1

1

You can specify only supported kernel parameters (sysctls) https://docs.docker.com/engine/reference/commandline/run/#configure-namespaced-kernel-parameters-sysctls-at-runtime

If you run ECS on EC2 you can update settings on instance boot.

  • Thanks for the answer! @roman-savchuk and what's the difference if I set up sysctl params in the EC2 ECS container Dockerfile or in the EC2 container instance itself? Which ones will work? – styleofspur Jan 27 '23 at 14:18