1

I have MySQL 5.5.44 installed native on a Lenovo X6 box with many cores, SSD, etc. /var/lib/mysql is symlinked off to a dir on an SSD.

I also have a docker 5.5.44 image present. The image is started this way:

sudo docker run --name buzz-mysql0 -v /data/2/mysqlvarlib/0:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -p 24000:3306 -d mysql:5.5

As you can see, /var/lib/mysql is volume mapped out of the container to the host on an SSD. Same SSD as the native MySQL. The host can talk to this instance on port 24000.

Both instances are out-of-the-box. No special conf options, tunings, etc.

I have a little Java program that runs in a tight loop with autoCommit(false)/commit() wrappers and inserts 6 columns of short strings and 2 dates. It uses mysql-connector-java-5.1.36-bin.jar.
Run against the MySQL at port 3306 (native), it runs at 5000 inserts/sec. Run against the MySQL at port 24000 which is the dockerized image, it runs at only 3400 inserts/sec. That's roughly 32% slower. Only one test is run at a time and the results do not vary.

I am hoping it is a matter of some tuning and not the volume mapping or port forwarding that is contributing to the slowness. If it was 10% slower I probably wouldn't care but 32% is a bit steep.

Buzz Moschetti
  • 7,057
  • 3
  • 23
  • 33
  • 1
    I think this question would be a better fit on http://dba.stackexchange.com/ – Jorge Campos Jul 20 '15 at 21:47
  • http://stackoverflow.com/a/26068476/1816093 – Drew Jul 20 '15 at 22:08
  • Of course there is extra overhead mostly with respect to routing. Your test seems tailored to measure that. Is this a real world application load? – user2105103 Jul 21 '15 at 14:20
  • Pretty much, yes. Bulk loads against multiple MySQL living on one box but at different ports. Again, I am not surprised it is slower. 32% seems a bit much but if that can be explained in terms of the specifics of routing (i.e. independent of docker per se) then so be it. – Buzz Moschetti Jul 21 '15 at 14:36

0 Answers0