Closed bekars closed 3 years ago
Hi @bekars . I think this is something @egernst looked into very recently, and found the interesting conclusion that how overlay2 affects nginx (which is after all a network test), is because the file served up by nginx (index.html??), is stored on the overlayed container FS - so, in the case of overlay2, that is backed by 9pfs, and the index.html is being fetched for every request over 9pfs, which is not by default caching. When using runc or devicemapper the file will be cached in the pagecache, so that overhead goes away.
I'm not sure there is an easy fix for the 9pfs itself - but, for the nginx test, to make it neutral of the backing filesystem, maybe we can get the nginx container setup to move the index.html into a tmpfs/ramfs?
I think @egernst may have had some other info around configuring nginx and ab (or alternatively maybe hey) to better measure performance under Kata. I'll leave that for @egernst now...
/cc @amshinde as well I think.
Hey @bekars - as @grahamwhaley summarized - index.html lives in the rootfs itself and isn't cached per se. So, each time nginx prices this, it accesses it through the file system. If it is backed by virtio-scsi (as is the case when you use direct-lvm), there is limited overhead. If it is backed by 9pfs (as is the case with overlay), then this introduces a considerable overhead, providing much worse performance. None of this has to do with network, as the bottleneck ends up becoming 9p.
I provided some of this feedback on threads to Baidu in the past -- does the analysis above make sense? I think this is ultimately a duplicate of issue #551
See the following issue for more details: https://github.com/kata-containers/runtime/issues/551#issuecomment-411121324
Thanks @egernst. Overlay2 is default on ubuntu. Do we have any plan to improve 9p performance here? Using cache?
https://www.kernel.org/doc/Documentation/filesystems/9p.txt
cache=mode specifies a caching policy. By default, no caches are used.
none = default no cache policy, metadata and data
alike are synchronous.
loose = no attempts are made at consistency,
intended for exclusive, read-only mounts
fscache = use FS-Cache for a persistent, read-only
cache backend.
mmap = minimal cache that is only used for read-write
mmap. Northing else is cached, like cache=none
@clarklee92 This issue was discussed by us on webchat and currently community are considering use virtio-fs to replace 9p as the sharing between host and guest. It is under evaluation now.
Description of problem
Kata performance under overlay2 is lower than direct-lvm, and lower than runc.
Expected result
The performance should be same under overlay2 and direct-lvm.
Actual result
Kata performance is bad in QPS test. It isn't good as runc.
Below is the test data:
Test Env
Test Method
kata-collect-data.sh
outputMeta details
Running
kata-collect-data.sh
version1.2.0 (commit 0bcb32f)
at2018-09-11.16:10:30.331708681+0800
.Runtime is
/usr/bin/kata-runtime
.kata-env
Output of "
/usr/bin/kata-runtime kata-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/kata-containers/configuration.toml
not found Output of "cat "/usr/share/defaults/kata-containers/configuration.toml"
":Image details
Initrd details
No initrd
Logfiles
Runtime logs
Recent runtime problems found in system journal:
Proxy logs
Recent proxy problems found in system journal:
Shim logs
No recent shim problems found in system journal.
Container manager details
Have
docker
Docker
Output of "
docker version
":Output of "
docker info
":Output of "
systemctl show docker
":No
kubectl
Packages
Have
dpkg
Output of "dpkg -l|egrep "(cc-oci-runtimecc-runtimerunv|kata-proxy|kata-runtime|kata-shim|kata-containers-image|linux-container|qemu-)"
":No
rpm