Closed EastonLee closed 3 years ago
# Meta details
Running `kata-collect-data.sh` version `1.11.0-alpha1 (commit )` at `2020-04-15.19:49:08.030969327+0800`.
---
Runtime is `/usr/bin/kata-runtime`.
# `kata-env`
Output of "`/usr/bin/kata-runtime kata-env`":
```toml
[Meta]
Version = "1.0.24"
[Runtime]
Debug = false
Trace = false
DisableGuestSeccomp = true
DisableNewNetNs = false
SandboxCgroupOnly = false
Path = "/usr/bin/kata-runtime"
[Runtime.Version]
OCI = "1.0.1-dev"
[Runtime.Version.Version]
Semver = "1.11.0-alpha1"
Major = 1
Minor = 11
Patch = 0
Commit = ""
[Runtime.Config]
Path = "/usr/share/defaults/kata-containers/configuration.toml"
[Hypervisor]
MachineType = "pc"
Version = "QEMU emulator version 4.1.1\nCopyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers"
Path = "/usr/bin/qemu-vanilla-system-x86_64"
BlockDeviceDriver = "virtio-scsi"
EntropySource = "/dev/urandom"
SharedFS = "virtio-9p"
VirtioFSDaemon = "/usr/bin/virtiofsd"
Msize9p = 8192
MemorySlots = 10
PCIeRootPort = 0
HotplugVFIOOnRootBus = false
Debug = false
UseVSock = false
[Image]
Path = "/usr/share/kata-containers/kata-containers-image_clearlinux_1.11.0-alpha1_agent_1f432c6896.img"
[Kernel]
Path = "/usr/share/kata-containers/vmlinuz-5.4.15.69-46.container"
Parameters = "systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket"
[Initrd]
Path = ""
[Proxy]
Type = "kataProxy"
Path = "/usr/libexec/kata-containers/kata-proxy"
Debug = false
[Proxy.Version]
Semver = "1.11.0-alpha1-e7d2214"
Major = 1
Minor = 11
Patch = 0
Commit = "e7d2214"
[Shim]
Type = "kataShim"
Path = "/usr/libexec/kata-containers/kata-shim"
Debug = false
[Shim.Version]
Semver = "1.11.0-alpha1-6a828a4"
Major = 1
Minor = 11
Patch = 0
Commit = "6a828a4"
[Agent]
Type = "kata"
Debug = false
Trace = false
TraceMode = ""
TraceType = ""
[Host]
Kernel = "4.15.0-42-corp-generic"
Architecture = "amd64"
VMContainerCapable = true
SupportVSocks = true
[Host.Distro]
Name = "Ubuntu"
Version = "16.04"
[Host.CPU]
Vendor = "GenuineIntel"
Model = "Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz"
[Netmon]
Path = "/usr/libexec/kata-containers/kata-netmon"
Debug = false
Enable = false
[Netmon.Version]
Semver = "1.11.0-alpha1"
Major = 1
Minor = 11
Patch = 0
Commit = "<
thanks @EastonLee - to help others diagnose, can you post:
mount
from inside the containerthat may help us understand what is mounted where and how - thanks!
hi @grahamwhaley thanks for the quick reply
on the host, to start the Kata container, I tried bind mount
docker run -d --privileged --runtime=kata-qemu --mount source=privileged_qemu_volume_ubuntu1604_04,target=/var/lib/docker --name=privileged_qemu_volume_ubuntu1604_04 harbor.corp.com/cloud/virtualdev:ubuntu1604 /lib/systemd/systemd
mount
output:
root@9bb85b430abe:/# mount
kataShared on / type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
kataShared on /etc/resolv.conf type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /etc/hostname type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /etc/hosts type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /var/lib/docker type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
root@9bb85b430abe:/#
root@9bb85b430abe:/# stat -f /var/lib/docker
File: "/var/lib/docker"
ID: 6d150c7e4dd9cbf9 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 12689695 Free: 741475 Available: 737379
Inodes: Total: 6400000 Free: 5660701
I also tried volume
docker run -d --privileged --runtime=kata-qemu --mount type=bind,source=/data/shared/privileged_qemu_bind_ubuntu1604_04,target=/var/lib/docker --name=privileged_qemu_bind_ubuntu1604_04 harbor.corp.com/cloud/virtualdev:ubuntu1604 /lib/systemd/systemd
the mount
output:
root@0470be26e35f:/# mount
kataShared on / type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
kataShared on /etc/resolv.conf type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /etc/hostname type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /etc/hosts type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
kataShared on /var/lib/docker type 9p (rw,nodev,relatime,dirsync,mmap,access=client,trans=virtio)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
root@0470be26e35f:/#
root@0470be26e35f:/#
root@0470be26e35f:/# stat -f /var/lib/docker
File: "/var/lib/docker"
ID: 6d150c7e4dd9cbf9 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 12689695 Free: 741481 Available: 737385
Inodes: Total: 6400000 Free: 5660703
The performance of docker pull python
with both configuration was slow.
Thx @EastonLee . For both those cases, that /var/lib/docker
is still a 9p mount in the mount
output. I'll /cc some others so they can help with details of why, and what the fix/workarounds might be. I'm not sure we have a comprehensive document on this... anybody know?
/cc @egernst @amshinde
Hi @EastonLee - If this is still a problem for you, please could you try this with Kata 2.0 which uses virtio-fs rather than 9p by default? Alternatively, feel free to close if not an issue any more.
Which feature do you think can be improved?
Docker in Kata performance
How can it be improved?
Docker pull can be faster
Additional Information
Nothing to add
Before raising this feature request
Have you looked at the limitations document?
Yes
First I found Docker in Kata can only start when --privileged is specified. But with the default kata-runtime, the DINK will fallback to vfs as storage driver, thus having bad performance, especially during the
docker pull
stage. Then I tried using bind mount and volume to mount/var/lib/docker
. docker pull in Kata was still slow,docker pull ubuntu:latest
took more than 1 minutes anddocker pull python:latest
took more than 8 minutes.I can understand the 9pfs in default kata-runtime is not performant, but I can't understand why bind mount and volume are also slow, since the IO ops go to host filesystem.
The result of kata-collect-data.sh is pasted bellow