Docker Community Forums

Share and learn in the Docker community.

Swap accounting not working on Ubuntu 18.04


(Servermeta) #1

Hello Everybody,

I bought a new dedicated server from OVH, and I can’t make swap accounting works. Has anyone else been able to make it work? Should I maybe compile the kernel?

It works on ubuntu 17.10, but with 18.04 I can’t make it works, I tried all kernels back to 4.13

root@proxima:~# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.05.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.13.16-041316-generic
Operating System: Ubuntu 18.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.33GiB
Name: proxima
ID: S6F3:6W74:VGH7:33WL:VRR5:6H4A:JQ4C:NBFA:G7AS:4HG4:HPAK:SZ4V
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Obviously I updated /etc/default/grub

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT=“cgroup_enable=memory swapaccount=1”
GRUB_CMDLINE_LINUX=""


(Servermeta) #2

the solution is to edit files in /etc/default/grub.d/ instead of editing the file /etc/default/grub .

Dunno why they changed it.