Docker Community Forums

Share and learn in the Docker community.

MySQL super SLOW in container, fast outside?


(Jjjk) #1

Hey Guys

Anyone experienced slowness issues with mysql/mariadb in a container?

I’ve got mariadb running in some containers via docker cloud and they are so slow

  • no memory or cpu limit
  • minimal other containers running
  • heaps of RAM

but when i install mariadb on the host and access it - its super FAST??

not sure if this is a networking issue, server issue, docker(cloud) issue etc…

  • have tested with various different mysql and mariadb images but its the same results :frowning:

anyone seen this issue or have any suggestions?

help would be greatly appreciated!!!



(Dkrebs) #2

I’m having the same problem:

_official mysql container
_host system Ubuntu 14.04
_/var/lib/mysql mounted via cogniteev/echo

Import of a 264M dump takes over an hour.

Any ideas?

(Nohup) #3

I have the same problem with a custom Percona image. Just creation of a table with partitions takes 15 minutes. Incredibly slow. When I run the same image in an externally hosted virtual machine (Ubuntu 14.04 with 3.x kernel), everything is fast so the problem is related to my machine (Ubuntu 14.04.4 with 4.x kernel), not the image.

The only thing that I can think of that could hinder the performance is the full disk encryption that I use. I have no idea if it might be an issue.

(Ajvr) #4

Same . I thought at first it was just my configuration .
But importing a 109KB file takes 10-20 minutes.

The solution for me is to mount the persistent data to my local

-v somewhere_in_local:/var/lib/mysql

this is for mariadb or mysql :slight_smile: now it just take seconds :smiley:

(Dmp1ce) #5

I am still having an issue with performance. I’m using the mariadb official docker image to develop Drupal websites. When I do a clear cache on the website it takes minutes to compete and pages take a long time to load too. I’m not sure how I could make mariadb perform faster. The Dockerfile already uses a volume for var/lib/mysql. What else can I do?

(Dmp1ce) #6

I changed the /var/lib/mysql volume to a location with a faster physical disk and I think it is working better.

(Tim.He) #7

Have a look at this.

I carried out some IO test on docker for MacOS, which may explain your problem.