Skip to content

Use BufferedInputStream to read from a tar file#402

Closed
mishail wants to merge 1 commit intodocker-java:2.xfrom
mishail:upload_fix
Closed

Use BufferedInputStream to read from a tar file#402
mishail wants to merge 1 commit intodocker-java:2.xfrom
mishail:upload_fix

Conversation

@mishail
Copy link
Copy Markdown
Contributor

@mishail mishail commented Dec 14, 2015

During my testing I've found that building an image with a fairly big context took a lot of time (several minutes) with docker-java. On the other hand, docker CLI was able to upload the very same context with the very same Dockerfile in 10-20 seconds.

After some profiling I've found out that we spent most time trying to read from a context's tar file, and it turned out we didn't use BufferedInputStream around FileInputStream.

Without the fix it took ~5 min to upload a ~153Mb context:

time="2015-12-14T20:27:45.165799084Z" level=info msg="POST /build?dockerfile=/Users/mikhail/.ahub/test_local/Dockerfile.sor.local&t=athena/sor:local"
time="2015-12-14T20:32:51.945725887Z" level=debug msg="[BUILDER] Use cached version: &{[/bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jvm/jre/]}"

And with the fix it takes ~20 sec:

time="2015-12-14T20:34:52.298037218Z" level=info msg="POST /build?dockerfile=/Users/mikhail/.ahub/test_local/Dockerfile.sor.local&t=athena/sor:local"
time="2015-12-14T20:35:13.645568956Z" level=debug msg="[BUILDER] Use cached version: &{[/bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jvm/jre/]}"

@marcuslinke
Copy link
Copy Markdown
Contributor

Already fixed in master via #359

@marcuslinke
Copy link
Copy Markdown
Contributor

Cherry-picked 1584e0d into 2.x branch

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants