Open Champ-Goblem opened 1 year ago
没有人处理吗?
From the top of my had I can't see how to fix it (in terms of replacing readlink()
with another syscall. You can disable process stats collections by appending process
to list of disable metric kinds, e.g. cadvisor --disable_metrics=process
. It may be possible to pass the same argument to kubelet
.
How to repair it? my kubernetes version is 1.23.0
After looking into the problem I, sadly, have to state that io_uring
does not support readlink
syscall. It does not seem to be possible to get same information using other, supported, syscalls.
On our nodes with a large number of pods (in excess of 150 in most cases) which may exhibit a large number of open file descriptors, we see that the kubelet running on these nodes is often using anywhere between 0.5-2 threads out of 24.
There must be millions of file descriptors on your pods pids, if it takes a complete CPU core.
Yes there will be, it is one of the downsides of running Kata with virtio-fs, it has a internal inode store that it uses which caches open file descriptors so it does not have to keep reopening them for each request.
On our nodes with a large number of pods (in excess of 150 in most cases) which may exhibit a large number of open file descriptors, we see that the kubelet running on these nodes is often using anywhere between 0.5-2 threads out of 24.
When flame-graphing the kubelet process we can see that the majority of the time is spent in the
processStatsFromProcs
function:This is due to the fact that the function performs a system call per
/proc/<pid>/fd
directory (readdir) and a system call per file descriptor listed in this directory (readlink). If there are a large number of open file descriptors and a large number of process running on these nodes, the overheads of these system calls add a lot of impact to the process.Is there a way to optimise this function to reduce the overall CPU usage of the kubelet?