Docker very slow in Fedora

Right, here’s the info of Ubuntu

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 95
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.0-35-generic
 Operating System: Ubuntu 22.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.32GiB
 Name: kubuntu-lg
 ID: Z3CI:QQJN:5RFF:APWC:NXVT:YKLA:4LQP:7EKR:AMCA:6MN6:KUTD:QBWL
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

and this is the one of Arch

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., 2.5.1)

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 95
 Server Version: 20.10.16
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16.m
 runc version:
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.43-1-lts
 Operating System: EndeavourOS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.32GiB
 Name: lg-eos
 ID: 6LEV:OBCB:BFH3:GDG5:66LT:HP52:5BGA:E2JA:4OFZ:YNND:24CO:6CAJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Some additional experiment results. I tried all of the following tweaks without success (I tested singularly, not all together):

  • disabled selinux
  • barrier=0 in /etc/fstab
  • dump set to 0 (instead of 1) in /etc/fstab (as in Ubuntu and Arch, where it defaults to 0)
  • increased ulimit -Hn to 1048576 (as in Ubuntu and Arch) from the default in Fedora 524288
  • disabled systemd-oomd

Some additional findings: I have no problem with mysql image mysql:8.0.29, so probably it’s something that shows up only with the older version of MySQL, but, as I said, this happens only in Fedora. It might be something wrong in the old version of the image, but it should work with Fedora anyway.

I tried with a VM (VirtualBox) of Fedora 36 where I used the default BTRFS and it works (today, I’ll try with a bare-metal installation of Fedora 36 with BTRFS and see what happens).

I’m inclined to think that the problem is really in Fedora EXT4 somehow (an older post had similar issues tommyj/kernel-grsec-server-kvm-host and the user solved that by switching from EXT4 to XFS).