This is a created article in which the information may have evolved or changed.
swarmctl
service
you can specify CPU
and resource limits when you create memory
:
# swarmctl service create --helpCreate a serviceUsage: swarmctl service create [flags]Flags:...... --cpu-limit string CPU cores limit (e.g. 0.5) --cpu-reservation string number of CPU cores reserved (e.g. 0.5)...... --memory-limit string memory limit (e.g. 512m) --memory-reservation string amount of reserved memory (e.g. 512m) ......
*-reservation
The role is to container
allocate and "Occupy" the corresponding resources, so these resources are container
necessarily available, *-limit
is to limit the container
resources used by the process. The code that parses the resource is located in the cmd/swarmctl/service/flagparser/resource.go
file.
Resources:
Docker Service Limits and reservations.