Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker incorrectly assumes swappiness can't be more than 100 #41534

Open
SharkWipf opened this issue Oct 8, 2020 · 2 comments
Open

Docker incorrectly assumes swappiness can't be more than 100 #41534

SharkWipf opened this issue Oct 8, 2020 · 2 comments
Labels
area/daemon area/runtime kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@SharkWipf
Copy link

Description
When passing the --swappiness flag to run or create with a value greater than 100, Docker will throw an error stating swappiness has to be between 0 and 100.
However, swappiness values above 100 are perfectly valid, and the swappiness setting is more than just a percentage knob.
Unless this is a limit in cgroups that isn't in-line with the kernel's own swappiness settings, Docker should accept swappiness values greater than 100 in line with the rest of the system.

Steps to reproduce the issue:

  1. Run any docker create or docker run command with --swappiness=133

Describe the results you received:

docker: invalid value: 133. Valid memory swappiness range is 0-100.
See 'docker create --help'.

Describe the results you expected:
Container starts normally with the specified swappiness setting.

Output of docker version:

Client:
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.15.2
 Git commit:        4484c46d9d
 Built:             Sun Sep 27 02:04:14 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.15.2
  Git commit:       4484c46d9d
  Built:            Sun Sep 27 02:03:53 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683b971d9c3ef73f284f176672c44b448662

Output of docker info:

N/A
@thaJeztah thaJeztah added area/daemon area/runtime kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Oct 8, 2020
@thaJeztah
Copy link
Member

Thanks for reporting; the original pull request doesn't motivate why 0-100 was picked at the time #14004, so not sure if there was a reason for this. We'd have to check if changing the range will cause issues, but otherwise I see no direct reason to disallow this.

@thaJeztah
Copy link
Member

/cc @AkihiroSuda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon area/runtime kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests

2 participants