-
Notifications
You must be signed in to change notification settings - Fork 443
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
MariaDB Performance in Docker is Half as Fast Compared to Running Directly on the Host System #629
Comments
Hi @justinh998 ! |
innodb-log-file-size is one of the key things to increase for bulk load (up to buffer pool size or more). If doing a lot of temporary on disk tables, MDEV-34577 seemed to be having some effect on the overlayfs on /tmp, where option 1) --temp-pool=1 , or option b) on the run make
As @fauust asked, we're still guessing because there are many ways to insert. Perf measurements of container (need capability |
If you're testing via a docker bridge network, consider disabling the EDIT: Sorry not sure why I was thinking network I/O when this is more of a disk I/O issue 😓 Another common gotcha I've noticed in the past was with FD limits in containers being set to Since Docker v25 that should be minimized, but another part of it was dependent upon Containerd 2.0 release (roughly around the start of 2025), which should be landing in Docker v28 release. You can check in the container with You rarely need a higher hard limit, but I recall for production databases there may be larger workloads where FWIW the higher soft limit should not be set on the container level, since some software can regress heavily in performance (excessive CPU usage iterating through FDs to close, or memory allocation which was reported for MySQL). |
I initially ran the MariaDB Docker container without any additional options (the container was placed in a Docker network and also received a volume mounted to /var/lib/mysql).
The performance seemed a bit slow to me (3000-4000 q/s when inserting 150000 rows), so I stopped the container and ran MariaDB directly on host (also without any additional options).
For the same 150000 rows, I then had a performance of 7000-8000 q/s.
MariaDB in the Docker container runs at half the speed compared to running directly on the host system.
I also tried to speed up the container with various options, but that didn't help either. Here is my final Docker Compose:
Does anyone have an idea why MariaDB in Docker is so slow?
The text was updated successfully, but these errors were encountered: