What is the difference between the performance of pull and push in docker
This article mainly introduces the performance of pull and push in docker is different, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.
0. Test environment
Basic architecture: no docker index, all operations take place between daemon and registry
Mirror:
# docker images-- tree Warning:'--tree' is deprecated, it will be removed soon. See usage. ├─ 9247a3750813 Virtual Size: 85.1 MB │ └─ a92b1d9f0ca5 Virtual Size: 1.078 GB Tags: 10.180.156.6:5000/bigtest2:latest
Network environment: there is a gigabit network between docker daemon and registry, the bandwidth is large enough.
1. Docker push log analysis and registry put comparison test
When making a docker push on the client, observe the log on the register side, and strip out some irrelevant logs, as follows:
10.180.156.11-- [02/Apr/2015:03:25:55 + 0000] "GET / v2 / HTTP/1.1" 404233 "" Go 1.1 package http "10.180.156.11-- [02/Apr/2015:03:25:55 + 0000]" GET / v1/_ping HTTP/1.1 "200"-"" Go 1.1 package http "02/Apr/2015:03:25:55 + 0000 DEBUG: args = {'namespace':' library' 02/Apr/2015:03:25:55 + 0000 ERROR: 10.180.156.11-[02/Apr/2015:03:25:55 + 0000] "PUT / v1/repositories/bigtest2/ HTTP/1.1" 2002 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:03:25:55 + 0000 DEBUG: args = {'image_id': upright 9247a37508136a5fe916f4f87bfa2a47f2edf8fc1a1ce787445b606d8fdbf9f'} 02/Apr/2015:03:25:55 + 0000 DEBUG: args = {' image_id': upland 92b1d9f0ca59cefd024a5f2f223e2d617b3e67cc2363c9998006fae87e5'} 02/Apr/2015:03:25:55 + 0000 DEBUG: api_error: Image not found10.180.156.11-[02/Apr/2015:03:25:55 + 0000] "GET / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1" 40428 "-" docker/1.5. 0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:03:25:55 + 0000 DEBUG: api_error: Image not found10.180.156.11-- [02/Apr/2015:03:25:55 + 0000]" GET / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1 "404 28"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel / 3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:03:25:55 + 0000 DEBUG: args = {'image_id': upland 9247a37508136a5fe916f4f87bfa2a47f2edf8fc1a1ce787445b606d8fdbf9f'} 10.180.156.11-[02/Apr/2015:03:25:56 + 0000]" PUT / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1 "200"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0 -32-generic os/linux arch/amd64 "= = 3 seconds = = 02/Apr/2015:03:25:57 + 0000 DEBUG: args = {'image_id': upland 9247a37508136a5fe916f4f87bfa2a47f2edf8fc1a1ce787445b606d8fdbf9f'} = = 34 seconds = = 10.180.156.11-- [02/Apr/2015:03:26:31 + 0000]" PUT / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer HTTP/1.1 "200"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32" -generic os/linux arch/amd64 "02/Apr/2015:03:26:31 + 0000 DEBUG: args = {'image_id': uplift 9247a37508136a5fe916f4f87bfa2a47f2edf8fc1a1ce787445b606d8fdbf9f'} 10.180.156.11-- [02/Apr/2015:03:26:31 + 0000]" PUT / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/checksum HTTP/1.1 "200"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch / amd64 "02/Apr/2015:03:26:31 + 0000 DEBUG: args = {'image_id': uplia92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} 10.180.156.11-[02/Apr/2015:03:26:32 + 0000]" PUT / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1 "200"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64" = = 6 seconds = = 02 / Apr/2015:03:26:37 + 0000 DEBUG: args = {'image_id': uprisa92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} = = 325s = = 10.180.156.11-[02/Apr/2015:03:32:02 + 0000] "PUT / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer HTTP/1.1" 200 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015 : 03:32:02 + 0000 DEBUG: args = {'image_id': uprisa92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} 10.180.156.11-- [02/Apr/2015:03:32:03 + 0000] "PUT / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/checksum HTTP/1.1" 200-"" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:03:32:03 + 0000 DEBUG: args = {'tag': upright latest.' 'namespace':' library', 'repository': upright bigtest 2'} 02/Apr/2015:03:32:03 + 0000 DEBUG: [put_tag] namespace=library Repository=bigtest2 Tag=latest10.180.156.11-[02/Apr/2015:03:32:03 + 0000] "PUT / v1/repositories/bigtest2/tags/latest HTTP/1.1" 200 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:03:32:03 + 0000 DEBUG: args = {'images': True,' namespace': 'library' 'repository': ubiquitous bigtest 2'} 10.180.156.11-[02/Apr/2015:03:32:03 + 0000] "PUT / v1/repositories/bigtest2/images HTTP/1.1" 204-"-"docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"
It can be found that for a layer 2 image, the entire push time can be divided into several segments.
Percentage of operation time put json13s0.8%put layer134s9.2%put json26s1.6%put layer2325s87.6% total time 371s 100%
In other words, 96.8% of the time was spent doing put layer1 and put layer2. So, how much time will it take to do pure PUT operations with the same file on the registry service?
# time curl-X PUT-H "Transfer-Encoding: chunked"-- data-binary @ layer-a92b1 "http://10.180.156.6:5000/v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer"truereal 0m44.571suser 0m0.302ssys 0m1.341s# time curl-X PUT-H" Transfer-Encoding: chunked "- data-binary @ layer-9247a" http://10.180.156.6:5000/v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer"truereal 0m4.277suser 0m0.029ssys 0m0.130s2. Docker pull Log Analysis and registry get comparison Test
Similar to the previous section, continue to do the log analysis of pull
10.180.156.11-- [02/Apr/2015:08:54:16 + 0000] "GET / v2 / HTTP/1.1" 404233 "" Go 1.1 package http "10.180.156.11-- [02/Apr/2015:08:54:16 + 0000]" GET / v1/_ping HTTP/1.1 "200"-"" Go 1.1 package http "02/Apr/2015:08:54:16 + 0000 DEBUG: args = {'namespace':' library' 'repository': ubiquitous bigtest 2'} 10.180.156.11-- [02/Apr/2015:08:54:16 + 0000] "GET / v1/repositories/bigtest2/images HTTP/1.1" 200152 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:54:16 + 0000 DEBUG: args = {'namespace': utilitarian' 'repository': ubiquitous bigtest 2'} 02/Apr/2015:08:54:16 + 0000 DEBUG: [get_tags] namespace=library Repository=bigtest210.180.156.11-- [02/Apr/2015:08:54:16 + 0000] "GET / v1/repositories/library/bigtest2/tags HTTP/1.1" 20078 "" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:54:16 + 0000 DEBUG: args = {'image_id': uplia92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} 10.180. 156.11-[02/Apr/2015:08:54:16 + 0000] "GET / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/ancestry HTTP/1.1" 200136 "" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:54:16 + 0000 DEBUG: args = {'image_id': upland 9247a37508136a5fe916f4f87bfa2a47f2edf8fc1a1ce787445b606d8fdbf9f'} 10.180.156.11-- [02/Apr/2015:08:54:17 + 0000] "GET / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1" 200619 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:54:17 + 0000 DEBUG: args = {'image_id': upright 9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'} = = 6 seconds = = 10.180.156.11-[02 /] Apr/2015:08:54:23 + 0000] "GET / v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer HTTP/1.1" 37124367 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:54:24 + 0000 DEBUG: args = {'image_id': uprisa92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} = = 42 seconds = = 02/Apr/2015:08:55:06 + 0000 DEBUG: api_error: Image not found10.180.156.11-- [02/Apr/2015:08:55:06 + 0000] "GET / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 404 28 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:55:06 + 0000 DEBUG: args = {'image_id': uplia92b1d9f0ca59cefd024a5f2f223e2d617b3e67cc2363c94998006fa87e60e5'} 10.180. 156.11-[02/Apr/2015:08:55:06 + 0000] "GET / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 1172 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "02/Apr/2015:08:55:07 + 0000 DEBUG: args = {'image_id': uprisa92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'} = = 2 seconds = = 10.180.156.11- -[02/Apr/2015:08:56:08 + 0000] "GET / v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer HTTP/1.1" 420084375 "-" docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64 "
It can be found that for a layer 2 image, the entire pull time can be divided into several segments.
Percentage of operation time get json16s5.1%get layer142s36.2%get json20s0%get layer22s1.7% total time 116s 100%
Contrast get testing directly from registry
# time curl-X GET-H "Transfer-Encoding: chunked"-o layer-9247a-down "http://10.180.156.6:5000/v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer"% Total% Received% Xferd Average Speed Time Current Dload Upload Total Spent Left Speed100 35.4M 100 35.4M 00 25.3M 00: 00:01 0:00:01- -:-25.3Mreal 0m1.409suser 0m0.036ssys 0m0.233s# time curl-X GET-H "Transfer-Encoding: chunked"-o layer-a92b1-down "http://10.180.156.6:5000/v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer"% Total% Received% Xferd Average Speed Time Current Dload Upload Total Spent Left Speed100 400M 100 400M 0 0 19.2 M 00: 00:20 0:00:20--:-24.5Mreal 0m20.771suser 0m0.381ssys 0m2.501s Thank you for reading this article carefully I hope the article "what is the difference between the performance of pull and push in docker" shared by the editor will be helpful to you. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!