Docker Community Forums

Share and learn in the Docker community.

Container with mount is extremely slow and choking the host

(Intiguaoran) #1

Expected behavior

My containers should get going quickly, like they do in Linux. Specifically, my Tomcat container should be fully initialized with my application in a minute or so.

Actual behavior

Tomcat takes forever to start, hardly any logs being printed out meaning it’s almost completely hung, and my Mac seems to be struggling (fan is going crazy).
Last line of Tomcat’s catalina.out log is “INFO: Deploying web application directory”, then nothing happens for a long time other than fan noise.
After a few minutes (!!!) I get the Tomcat localhost log to tell me that Spring is starting to load my app, at this stage there is usually a whole bunch of log prints spewing out - but nothing in this Docker for Mac environment.
Eventually I killed it after a few more minutes, feeling pity for my poor Mac.


MacBook Pro (13-inch, Late 2011), 2.8 GHz Intel Core i7, 8GB memory, OSX version 10.11.3

========= Here is my Docker Compose setup:
image: "postgres:9.4"

  • "15432:5432"
    • .workspace/postgres/pgdata:/pgdata
      POSTGRES_USER: "foo"
      PGDATA: "/pgdata"
      POSTGRES_DB: "bla"
      image: "my-dev-server"
    • “8080:8080”
    • “5050:5050”
    • "19010:9010"
    • .workspace/server/tomcat/webapps:/usr/share/tomcat/default/webapps
    • .workspace/server/tomcat/logs:/usr/share/tomcat/default/logs
    • .workspace/server/tomcat/conf/app.base.config.xml:/usr/share/tomcat/default/conf/app.base.config.xml
    • .workspace/server/tomcat/conf/
    • .workspace/server/tomcat/conf/
    • db

========= Here is my server Dockerfile:
FROM centos:7.2.1511
RUN yum install -y logrotate initscripts less
ADD rpms /rpms
RUN rpm -i /rpms/jre-.rpm /rpms/myapp-.rpm
VOLUME /usr/share/tomcat/default/logs
VOLUME /usr/share/tomcat/webapps
ENV JAVA_HOME /usr/java/default
ENV CATALINA_HOME /usr/share/tomcat/default
ENV CATALINA_OPTS="-XX:-UseSplitVerifier -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Xmx$[MEM_AMNT]m -XX:MaxPermSize=512m"
ENTRYPOINT exec ${CATALINA_HOME}/bin/ jpda run

=========== Pinata output:
OS X: version 10.11.3 (build: 15D21) version v1.11.0-beta9
Running diagnostic tests:
[OK] docker-cli
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160505-104839.tar.gz
Most specific failure is: No error was detected
Your unique id is: B938D73D-AD93-4870-AAFE-192989DFDF84
Please quote this in all correspondence.

Steps to reproduce the behavior

  1. Create a server docker file running Tomcat, where you mount the webapp directory and a few init files from the host (see my Dockerfile for the server above)
  2. Run docker compose.

(Ksandr) #2

Same for me. Ruby on Rails app. Loading page takes 2-3 minutes. With parallels desktop driver it takes up to 10 seconds, usually 2-3 sec.

(Jared Stenquist) #3

Here is a relevant thread that has had a lot of activity

(Chris Dostert) #4

docker 1.11.1-beta11 still same issue; completely unusable.

(Misterdai) #5

Upgraded to docker 1.11.1-beta12, still experiencing the same issue. If I’m using a mount it’s painfully slow.

(Tcmug) #6

Same here, though I would add that its slightly better than .beta11. Still far from the virtualbox nfs docker-machine I have configured.

(Misterdai) #7

Seems to be related to this other post that’s far more in-depth. File access in mounted volumes extremely slow, CPU bound

Appears to be down to the performance of osxfs being used for the volume mounts.