Skip to content

Limiting SWAP usage in Swarm Mode? #34654

@SvenAbels

Description

@SvenAbels

Description
I'm using docker swarm mode to start a service with

    --limit-memory 2GB \

and the container then used 2GB plus abrou 4GB SWAP.
I was looking for a way to limit or remove the SWAP capabilities of the service but without any luck in the docker service create documentation.

As far as I can see, "normal" docker containers can be limited with --memory-swap.

How can we remove the SWAP space for services in swarm mode?

Steps to reproduce the issue:

  1. Start a service and limit it's memory
  2. Make the task consume more memory than the limit

Output of docker version:

17.06

Additional environment details (AWS, VirtualBox, physical, etc.):
Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions