Skip to content

container IO is slower than expected #245

Closed

Description

@mavenraven

in t2.medium vm:

root@ip-172-31-1-59:/home/ubuntu/nested-docker-container# time docker run cloudfoundryinstaller/cloudfoundry-installer-release-candidate
Unable to find image 'cloudfoundryinstaller/cloudfoundry-installer-release-candidate:latest' locally
latest: Pulling from cloudfoundryinstaller/cloudfoundry-installer-release-candidate
024d1d9b7df6: Pull complete
3df641079856: Pull complete
74f07147d3f2: Pull complete
e62b7c17ab52: Pull complete
86aac04ae65f: Pull complete
f191ae60037e: Pull complete
4c123a81e02c: Pull complete
ab2c51c924e6: Pull complete
25caf520a6ef: Pull complete
03a96676b2ef: Pull complete
1ff7e523f26f: Pull complete
2f2922f2c3cf: Pull complete
f41009d07aaf: Pull complete
ecef1a01ba69: Pull complete
cd0ae42a62b4: Pull complete
Digest: sha256:1933bc3dbe5fa46113f2be7744d5ab7a99ff5291898be2a81279bf74c8d66e87
Status: Downloaded newer image for cloudfoundryinstaller/cloudfoundry-installer-release-candidate:latest
/cloudfoundry-installer/scripts/generate_new_cf_deployment_dir: line 14: AWS_ACCESS_KEY_ID: Must set AWS_ACCESS_KEY_ID (e.g. AKIAIOSFODNN7EXAMPLE)

real    1m13.348s
user    0m0.197s
sys     0m0.066s

in m3.2xlarge concourse vm, in privileged container:

time docker load -i cloudfoundry-installer-image-rc/image

real    3m47.455s
user    0m0.343s
sys 0m2.446s
time docker run `cat cloudfoundry-installer-image-rc/repository`@`cat cloudfoundry-installer-image-rc/digest`
Unable to find image 'cloudfoundryinstaller/cloudfoundry-installer-release-candidate@sha256:1933bc3dbe5fa46113f2be7744d5ab7a99ff5291898be2a81279bf74c8d66e87' locally
sha256:1933bc3dbe5fa46113f2be7744d5ab7a99ff5291898be2a81279bf74c8d66e87: Pulling from cloudfoundryinstaller/cloudfoundry-installer-release-candidate
2a6bd5375f3f: Pull complete
6c71485a46db: Pull complete
7d4387f06e3c: Pull complete
cfd0b4799752: Pull complete
f84830f81218: Pull complete
3ffffbdf0686: Pull complete
6dd2eef8dfcd: Pull complete
4fba50b88505: Pull complete
1863f8375deb: Pull complete
679fc1cd9fba: Pull complete
65d76912b02f: Pull complete
d8def8c4fe0c: Pull complete
d51e688b3dc5: Pull complete
3d5efd074e1d: Pull complete
bebad5f334b4: Pull complete
4b9d77ed32d0: Pull complete
cb31b38cc06f: Pull complete
c2baed68fc3f: Pull complete
7cfee2994c82: Pull complete
Digest: sha256:1933bc3dbe5fa46113f2be7744d5ab7a99ff5291898be2a81279bf74c8d66e87
Status: Downloaded newer image for cloudfoundryinstaller/cloudfoundry-installer-release-candidate@sha256:1933bc3dbe5fa46113f2be7744d5ab7a99ff5291898be2a81279bf74c8d66e87
/cloudfoundry-installer/scripts/generate_new_cf_deployment_dir: line 14: AWS_ACCESS_KEY_ID: Must set AWS_ACCESS_KEY_ID (e.g. AKIAIOSFODNN7EXAMPLE)

real    5m32.069s
user    0m0.201s
sys 0m0.253s

It takes longer to load an image in the Garden containers than it does to download and run on the VM. I'd expect the performance to be about the same, since I'm trying to do the equivalent of

docker run -it -v /var/run/docker.sock:/var/run/docker.sock

in my privileged task. Is this expected behavior?

Activity

  1. concourse-bot commented on Dec 28, 2015

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  2. vito commented on Dec 28, 2015

    @vito
    Contributor

    What's the setup for your task's Docker daemon's graph dir? Since it's running in a container with aufs as the rootfs, it may be falling back on the dummy vfs driver which is slow and expensive (disk space/IO). You could try making a tmpfs and pointing it at that instead.

  3. mavenraven commented on Dec 28, 2015

    @mavenraven
    Author

    Is using tmpfs supported? I tried

    mkdir -p /mnt/ramdisk
    mount -t tmpfs -o size=4g tmpfs /mnt/ramdisk/
    docker daemon -s=tmpfs -g=/mnt/ramdisk
    

    and get

    ERRO[0000] Failed to GetDriver graph tmpfs /mnt/ramdisk
    FATA[0000] Error starting daemon: error initializing graphdriver: driver not supported
    

    Here's mount:

    cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)
    tmpfs on /mnt/ramdisk type tmpfs (rw,size=4g)
    
  4. vito commented on Dec 28, 2015

    @vito
    Contributor

    Only pass -g, not -s. It's not its own driver, it just determines what drivers it can use. So it should pick aufs or something probably.

  5. mavenraven commented on Dec 28, 2015

    @mavenraven
    Author

    Yeah, I actually just tried aufs instead, and it seemed to work.

  6. mavenraven commented on Dec 28, 2015

    @mavenraven
    Author

    It's much better now, thanks @vito!

     * Starting Docker: docker
       ...done.
    importing...
    c4e86244d45f4c91ee3aabd9b92eb680489b083247a729379221dbcfb8ad1c53
    
    real    0m13.035s
    user    0m0.272s
    sys 0m1.156s
    loading...
    
    real    0m20.334s
    user    0m0.394s
    sys 0m1.465s
    

    Here's what I did, if it should be documented somewhere:

    set -e
    mkdir /mnt/ramdisk
    mount -t tmpfs -o size=6g tmpfs /mnt/ramdisk/
    echo 'DOCKER_OPTS="-g=/mnt/ramdisk"' >> /etc/default/docker
    service docker start
    

    in my script, and

     - task: stand-up-env
        file: cloudfoundry-installer-ci/tasks/stand-up-env.yml
        privileged: true
    

    in my pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions