Use MCR with Docker Swarm

Swarm overview

Mirantis Container Runtime (MCR) supports the use of Docker Swarm.

The following Docker documentation topics offer detailed information that can help you to run MCR in swarm mode:

Swarm service memory and OOM tuning

Swarm mode offers the same broad capabilities as upstream Docker Engine for services and stacks, including networking, placement, secrets, volumes, and the full set of options on docker service create and docker service update.

Used alongside --limit-memory, CPU limits, and other supported options, the following additional flags provide more fine-grained service resource control:

Flag

Description

–memory-swap

Constrains how much disk-backed swap can back a task when physical memory is exhausted. Allowing swap can keep a service running but often increases latency; disabling or tightening swap can make performance more predictable at the cost of earlier failure under pressure.

–memory-swappiness

Influences how aggressively the kernel can move anonymous pages to swap, which affects responsiveness versus reclaim behavior.

–oom-score-adj

Tunes the host out-of-memory killer’s preference for terminating task processes relative to other processes, so you can favor critical services or deprioritize expendable ones.

These settings interact with cgroup configuration, kernel behavior, and other resource limits.

Tip

Try out your changes in a test environment and validate under realistic load before making a broad rollout.

When you create or update a service, combine the additional flags with --limit-memory, any other resource options, and the rest of the service definition that the workload requires.

For current flag names, defaults, accepted values, and units, run:

docker service create --help
docker service update --help