Add memory swap to swarm

Adds support for setting memory swap settings on Swarm services

* Adds flags `memory-swap` and `memory-swappiness` to `docker service
create` and `docker service update` commands.
* Adds compose fields `memswap_limit` and `mem_swappiness` for `docker
stack` commands.

Signed-off-by: Drew Erny <derny@mirantis.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Drew Erny
2025-11-07 00:24:44 +01:00
committed by Sebastiaan van Stijn
parent d0c86d39ef
commit 71828f2792
13 changed files with 98 additions and 11 deletions
@@ -40,6 +40,8 @@ Create a new service
| `--log-driver` | `string` | | Logging driver for service |
| `--log-opt` | `list` | | Logging driver options |
| `--max-concurrent` | `uint` | | Number of job tasks to run concurrently (default equal to --replicas) |
| `--memory-swap` | `bytes` | `0` | Swap Bytes (-1 for unlimited) |
| `--memory-swappiness` | `int64` | `-1` | Tune memory swappiness (0-100), -1 to reset to default |
| `--mode` | `string` | `replicated` | Service mode (`replicated`, `global`, `replicated-job`, `global-job`) |
| [`--mount`](#mount) | `mount` | | Attach a filesystem mount to the service |
| `--name` | `string` | | Service name |
@@ -53,6 +53,8 @@ Update a service
| `--log-driver` | `string` | | Logging driver for service |
| `--log-opt` | `list` | | Logging driver options |
| `--max-concurrent` | `uint` | | Number of job tasks to run concurrently (default equal to --replicas) |
| `--memory-swap` | `bytes` | `0` | Swap Bytes (-1 for unlimited) |
| `--memory-swappiness` | `int64` | `-1` | Tune memory swappiness (0-100), -1 to reset to default |
| [`--mount-add`](#mount-add) | `mount` | | Add or update a mount on a service |
| `--mount-rm` | `list` | | Remove a mount by its target path |
| [`--network-add`](#network-add) | `network` | | Add a network |