我最近在EC2实例中升级了Docker版本。
升级后,我发现容器启动时间太慢。我可以重现此问题,因为它可以使用旧的备份AMI。
使用 docker 18.06.1-ce
$ time docker run -i hello-world > /dev/null
real 0m0.574s
user 0m0.061s
sys 0m0.013s
使用 docker 17.03.1-ce
time docker run -i hello-world > /dev/null
real 0m0.160s
user 0m0.013s
sys 0m0.000s
对于像openjdk.10-slim之类的较大图像,现在需要花费几秒钟,相比之下,旧版本中为200ms。
请让我知道默认配置是否已更改。
我同时附上了两个码头工人信息。
docker 18.06.1-ce 的docker信息输出
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 4
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-34-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.851GiB
Name: ip-172-31-35-187
ID: NIQ5:2NDW:SB77:ZNZU:UO6G:EYLB:JIW7:SQLL:QLWY:LNRM:SU6P:ZS7X
Docker Root Dir: /data2/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
docker 17.03.1-ce
的docker info输出Containers: 5
Running: 0
Paused: 0
Stopped: 5
Images: 2
Server Version: 17.03.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
apparmor
Kernel Version: 4.15.0-34-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 983.5 MiB
Name: ip-172-31-18-230
ID: NIQ5:2NDW:SB77:ZNZU:UO6G:EYLB:JIW7:SQLL:QLWY:LNRM:SU6P:ZS7X
Docker Root Dir: /data2/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false