From 9bc4cd536e3de8968f5ae807cb4a8beb1e89eeee Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 5 May 2016 21:45:55 -0700 Subject: [PATCH] Docker pull/push with max concurrency limits. This fix tries to address issues raised in #20936 and #22443 where `docker pull` or `docker push` fails because of the concurrent connection failing. Currently, the number of maximum concurrent connections is controlled by `maxDownloadConcurrency` and `maxUploadConcurrency` which are hardcoded to 3 and 5 respectively. Therefore, in situations where network connections don't support multiple downloads/uploads, failures may encounter for `docker push` or `docker pull`. This fix tries changes `maxDownloadConcurrency` and `maxUploadConcurrency` to adjustable by passing `--max-concurrent-uploads` and `--max-concurrent-downloads` to `docker daemon` command. The documentation related to docker daemon has been updated. Additional test case have been added to cover the changes in this fix. This fix fixes #20936. This fix fixes #22443. Signed-off-by: Yong Tang --- docs/reference/commandline/dockerd.md | 6 ++++++ man/dockerd.8.md | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 2ecadbed5c..c3caa10fcd 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -54,6 +54,8 @@ weight = -1 --log-driver="json-file" Default driver for container logs --log-opt=[] Log driver specific options --mtu=0 Set the containers network MTU + --max-concurrent-downloads=3 Set the max concurrent downloads for each pull + --max-concurrent-uploads=5 Set the max concurrent uploads for each push --disable-legacy-registry Do not contact legacy registries -p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file --raw-logs Full timestamps without ANSI coloring @@ -913,6 +915,8 @@ This is a full example of the allowed configuration options in the file: "cluster-store": "", "cluster-store-opts": [], "cluster-advertise": "", + "max-concurrent-downloads": 3, + "max-concurrent-uploads": 5, "debug": true, "hosts": [], "log-level": "", @@ -963,6 +967,8 @@ The list of currently supported options that can be reconfigured is this: - `cluster-store-opts`: it uses the new options to reload the discovery store. - `cluster-advertise`: it modifies the address advertised after reloading. - `labels`: it replaces the daemon labels with a new set of labels. +- `max-concurrent-downloads`: it updates the max concurrent downloads for each pull. +- `max-concurrent-uploads`: it updates the max concurrent uploads for each push. Updating and reloading the cluster configurations such as `--cluster-store`, `--cluster-advertise` and `--cluster-store-opts` will take effect only if diff --git a/man/dockerd.8.md b/man/dockerd.8.md index 2c381fb0f7..122609ee19 100644 --- a/man/dockerd.8.md +++ b/man/dockerd.8.md @@ -44,6 +44,8 @@ dockerd - Enable daemon mode [**--log-driver**[=*json-file*]] [**--log-opt**[=*map[]*]] [**--mtu**[=*0*]] +[**--max-concurrent-downloads**[=*3*]] +[**--max-concurrent-uploads**[=*5*]] [**-p**|**--pidfile**[=*/var/run/docker.pid*]] [**--raw-logs**] [**--registry-mirror**[=*[]*]] @@ -197,6 +199,12 @@ unix://[/path/to/socket] to use. **--mtu**=*0* Set the containers network mtu. Default is `0`. +**--max-concurrent-downloads**=*3* + Set the max concurrent downloads for each pull. Default is `3`. + +**--max-concurrent-uploads**=*5* + Set the max concurrent uploads for each push. Default is `5`. + **-p**, **--pidfile**="" Path to use for daemon PID file. Default is `/var/run/docker.pid`