Hi
I saw similar posts, but I did not find any working solution there.
Since I started to use Fedora 36 and docker (not podman, nor moby) I noted that many operations on containers are really slow! Much slower than with Ubuntu and Arch (same machine, different Linux distros; yes, I have 3 of them on the same machine: 16Gb, i7, SSD NVM, so a fast machine).
Much slower means: 10 times slower (an order of magnitude).
I note this slowness basically when:
- running Ansible molecule docker tests
- starting a MySql container
I seem to understand that the problem is I/O operations (e.g., with Ansible Molecule, the problem shows up with a task that installs a flatpak or installs a AUR package). This is an example of Ansible task that when tested with Molecule Docker in Fedora takes is 10 time slower than in Ubuntu and Arch:
- name: Install Gnome Extension Manager
become: yes
community.general.flatpak:
name: com.mattjakeman.ExtensionManager
state: present
Concerning the MySql container, this is a Maven POM that starts a MySql Docker container and waits for it to be ready (by intercepting a string on the log):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-docker-mysql</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.40.0</version>
<extensions>true</extensions>
<configuration>
<showLogs>true</showLogs>
<images>
<image>
<alias>database</alias>
<name>mysql:5.7</name>
<run>
<wait>
<log>MySQL init process done. Ready for start up.</log>
<time>200000</time>
</wait>
<env>
<MYSQL_ROOT_PASSWORD>apasswd</MYSQL_ROOT_PASSWORD>
<MYSQL_DATABASE>adatabase</MYSQL_DATABASE>
<MYSQL_USER>auser</MYSQL_USER>
<MYSQL_PASSWORD>anotherpasswd</MYSQL_PASSWORD>
</env>
<ports>
<port>${mysql.port}:3306</port>
</ports>
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
This is the time in Fedora
[INFO] DOCKER> [mysql:5.7] "database":
Waited on log out 'MySQL init process done. Ready for start up.'
69823 ms
And this is the result in Ubuntu and Arch (the time is basically the same in the two distributions):
[INFO] DOCKER> [mysql:5.7] "database":
Waited on log out 'MySQL init process done. Ready for start up.'
6032 ms
So, 10 times slower!
Moreover, when running these tests on Fedora (both the Ansible task and the Maven build), the disk usage is impressive, not to mention that the RAM is immediately filled!
This is the docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.17
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: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc version: v1.1.2-0-ga916309
init version: de40ad0
Security Options:
seccomp
Profile: default
cgroupns
Kernel Version: 5.17.12-300.fc36.x86_64
Operating System: Fedora Linux 36 (Workstation Edition)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.32GiB
Name: lg-fedora
ID: USS4:ISHJ:ID4Y:EPY3:QKR2:O5GQ:5OTP:MFHC:3OZK:MP27:L4DY:DYOO
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
Fedora is installed on EXT4, just like the other distributions…
Any idea of the culprit?