Closed pangpu closed 3 years ago
# Meta details
Running `kata-collect-data.sh` version `1.12.0-rc0 (commit )` at `2020-12-07.19:02:13.348148264+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.12.0-rc0"
Major = 1
Minor = 12
Patch = 0
Commit = ""
[Runtime.Config]
Path = "/usr/share/defaults/kata-containers/configuration.toml"
[Hypervisor]
MachineType = "pc"
Version = "QEMU emulator version 5.0.0\nCopyright (c) 2003-2020 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.12.0-rc0_agent_5cfb8ec960.img"
[Kernel]
Path = "/usr/share/kata-containers/vmlinuz-5.4.60.89-51.container"
Parameters = "systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket scsi_mod.scan=none"
[Initrd]
Path = ""
[Proxy]
Type = "kataProxy"
Path = "/usr/libexec/kata-containers/kata-proxy"
Debug = false
[Proxy.Version]
Semver = "1.12.0-rc0-adde733"
Major = 1
Minor = 12
Patch = 0
Commit = "<
By default, you are using virtiofs, which exposes the host filesystem to the guest. As a result, there is no guest memory needed for caching the files, since what you see are really host files, and caching does occur in the host.
If you want to see the results you expect, you need to pass a block volume, in which case there would be some guest-side caching.
Description of problem
Hi I want to test the IO performance in the kata container, and I build a base Ubuntu docker image with fio (the Dockerfile is shown as follows)
FROM ubuntu:18.04
RUN apt update && apt install -y fio \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
I create a container with kata runtime and 12GB memory:
sudo docker run --runtime=kata-qemu-virtiofs -m 12G --memory-swap=12G -it local/fio bash
Then I run fio:
fio -filename=/test -direct=0 -iodepth 128 -thread -rw=randwrite -ioengine=psync -bs=128k -size=256G -numjobs=1 -runtime=180 -group_reporting -name=randwrite_128k
We know that when Linux is handling I/O request, its Virtual Memory subsystem caches dirty pages in the memory and write them to the disk after some time.
/proc/sys/vm/dirty_ratio
controls how large space will be used to cache dirty pages.In my container,
/proc/sys/vm/dirty_ratio
is set to 20When fio is running, I turn to
cat /proc/meminfo
to see how many pages are cached and writeback:Expected result
about 20% * 12G = 2.4G page will be cached
Actual result
0 kB Dirty, 0 kB Writeback
Further information
Since the kernel in Kata Container is isolated, I wonder whether Kata Container supports isolated page cache mechanism?Or all the dirty pages of Kata Container are all cached by the kernel of host OS?