You are not logged in.

#1 2015-01-05 23:30:30

0x000000
Member
Registered: 2011-11-23
Posts: 57

[SOLVED] Very slow Docker MySQL container

I'm running some MySQL migrations on a Docker container. This is the first time I've ever used Docker, but I'm both disappointed and confused by it. The migrations I need to run are just a bunch of CREATE and ALTER statements (probably in the hundreds). It's bananas slow in the Docker container, between 2-6 seconds for a create, sometimes as long as 15s for an ALTER. A migration that should take around one minute ends up taking around 30. I'm running an i7 with 16GB of memory, so I don't think this should be an issue. For what it's worth, I've never experienced poor performance like this on my local MySQL server.

I'm monitoring the situation with iotop and I see [jdb2/sdb2-8] and [jdb2/dm-1-8] up at 99% for IO. I don't know what's going on, nor do I really know where to start looking.

Last edited by 0x000000 (2015-01-06 16:19:07)

Offline

#2 2015-01-05 23:53:00

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Very slow Docker MySQL container

What storage driver are you using (see 'docker info')? If you are using devicemapper, which is the default unless you have an AUFS enabled kernel or a btrfs partition, I'd suggest creating a btrfs partition for /var/lib/docker and trying again. The btrfs and aufs storage backends are substantially faster in my experience.

Scott

Offline

#3 2015-01-06 16:12:30

0x000000
Member
Registered: 2011-11-23
Posts: 57

Re: [SOLVED] Very slow Docker MySQL container

Well, I had to run out and buy a new hard drive to make that happen, but wow, order of magnitude improvement. Thanks!

(should I mark this as solved? Buying a new hard drive doesn't seem like the best solution)

Offline

#4 2015-01-06 16:14:39

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Very slow Docker MySQL container

Heh smile Was it the new hard drive or the btrfs? In either case, I think solved would be appropriate.

Offline

#5 2015-01-06 16:18:51

0x000000
Member
Registered: 2011-11-23
Posts: 57

Re: [SOLVED] Very slow Docker MySQL container

Hard to know for sure, but I'm thinking btrfs. jbd2 wasn't going nuts on IO this time around.

Offline

#6 2015-01-06 17:28:08

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Very slow Docker MySQL container

If you've got anything really important in those containers, make sure you've got good backups and a UPS. My server got really hosed once after a power loss hmm

Offline

Board footer

Powered by FluxBB