You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by David Keijser <da...@klarna.com> on 2016/03/23 14:08:21 UTC
limit swap usage with docker containeriser
Hi
I'm looking for a way of limiting the swap usage of tasks running as
docker containers. My use case is exactly the same as in MESOS-1662 but
the flag introduced to fix that does not apply to docker from what I can
tell.
Setting a custom docker flag to limit total memory to be the same as the
memory resource is a possible work around but doing that puts the
Responsibility to of keeping the values in sync on the one running tasks
through e.g marathon and not on the operator of the cluster.
Any ideas? How hard would it be to change so that flag also applies for
docker?
Re: limit swap usage with docker containeriser
Posted by Guangya Liu <gy...@gmail.com>.
The reason is that DockerContainerizer is using doker CLI to create
container, Docker performs the initial container configuration, while
modifying resources (CPU, memory, etc.) and the DockerContainerizer cannot
compose with other existing and future Mesos isolators, such as the cgroups/mem
isolator which is required by you.
I think that you can have a try for MesosContainerizer with docker image,
you can refer to a simple tutorial here:
https://github.com/apache/mesos/blob/master/docs/container-image.md#test-it-out
Thanks,
Guangya
On Thu, Mar 24, 2016 at 5:03 PM, David Keijser <da...@klarna.com>
wrote:
> On Thu, Mar 24, 2016 at 12:12:56AM +0800, haosdent wrote:
> > Yes, this flag only available in mesos containerizer.
> >
>
> Why? :)
>
> I can't imagine why this wouldn't be desired when using the docker
> containeriser. Is this something that would be hard to support for
> docker and that's why it was not added?
>
Re: limit swap usage with docker containeriser
Posted by David Keijser <da...@klarna.com>.
On Thu, Mar 24, 2016 at 12:12:56AM +0800, haosdent wrote:
> Yes, this flag only available in mesos containerizer.
>
Why? :)
I can't imagine why this wouldn't be desired when using the docker
containeriser. Is this something that would be hard to support for
docker and that's why it was not added?
Re: limit swap usage with docker containeriser
Posted by haosdent <ha...@gmail.com>.
Yes, this flag only available in mesos containerizer.
On Wed, Mar 23, 2016 at 10:11 PM, David Keijser <da...@klarna.com>
wrote:
> On Wed, Mar 23, 2016 at 09:42:50PM +0800, haosdent wrote:
> > Do you mean add `memory-swap` when start docker container in Mesos? There
> > is a field `repeated Parameter parameters = 5;` in DockerInfo proto. You
> > could pass your docker running parameters in this field.
>
> What I'm looking for is a flag (like `cgroups_limit_swap`) to always
> enable limits on both memory and swap based on the resources allocated.
> Without the need for every framework to add the memory-swap docker
> option to each task.
>
--
Best Regards,
Haosdent Huang
Re: limit swap usage with docker containeriser
Posted by David Keijser <da...@klarna.com>.
On Wed, Mar 23, 2016 at 09:42:50PM +0800, haosdent wrote:
> Do you mean add `memory-swap` when start docker container in Mesos? There
> is a field `repeated Parameter parameters = 5;` in DockerInfo proto. You
> could pass your docker running parameters in this field.
What I'm looking for is a flag (like `cgroups_limit_swap`) to always
enable limits on both memory and swap based on the resources allocated.
Without the need for every framework to add the memory-swap docker
option to each task.
Re: limit swap usage with docker containeriser
Posted by haosdent <ha...@gmail.com>.
Do you mean add `memory-swap` when start docker container in Mesos? There
is a field `repeated Parameter parameters = 5;` in DockerInfo proto. You
could pass your docker running parameters in this field.