Mesos cpu and memory values for docker task are mapped to which docker run parameters

56 views
Skip to first unread message

max

unread,
Jun 25, 2016, 5:19:35 PM6/25/16
to meso-user
Hello
I'm just trying to understand which docker run command attributes are mapped to mesos cpu and memory limits that we given while spinning up a docker task?

max

unread,
Aug 18, 2016, 7:15:10 PM8/18/16
to meso-user
Did some more research and here is the outcome => 

Attributes and their importance:

1)     cpu:

a.      Mesos uses this value to limit the number of tasks executed on a worker node. A new task will be executed only if cpu requested < total cpu available (as per calculations of mesos and mesos is not fetching this info from actual cpu utilization on the target worker in any way). Every time a new task is executed mesos will keep subtracting the cpu requested from the total cpu number which it maintains locally(and we see the same stats on mesos UI).

b.     Along with that the cpu value is translated to Docker’s “--cpu-shares” attribute and hence dictates how much of CPU time is available to that container. Overall it’s just a relative weight attached to container process.

c.      Docker does have runtime attributes as “--cpu-quota” which can be used to limit the cpu utilization by containers however mesos doesn’t have the feature to control that right now.

e.g.

Container A with 0.1 and container B with 0.2 cpu-share just means that if both of them are to consume 100% of CPU then A will get 33% of CPU time and B will get 66% of CPU time.

2)     Memory:

a.      Same as in case of cpu, memory attribute passed via  marathon is used by mesos to calculate the free resources on the worker nodes for spinning new tasks.

b.     Along with that the memory value from marathon->mesos gets translated to Docker’s “--memory” attribute which defines the upper limit of memory the container can utilize. If it crosses that then it’ll be killed by the Docker daemon.

Reply all
Reply to author
Forward
0 new messages