You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intro:
We call cadvisor subcontainers API to obtain the data of all cgroup containers. With the increase of QPS, the frequency of cgroup read will increase, which will aggravate the pressure of kernfs file system lock and even cause machine hang.
Question:
Do we need to read the cgroup less frequently when we call GetInfo to fetch ContainerInfo data by caching it?
func (m *manager) containerDataToContainerInfo(cont *containerData, query *info.ContainerInfoRequest) (*info.ContainerInfo, error) {
// Get the info from the container.
cinfo, err := cont.GetInfo(true)
if err != nil {
return nil, err
}
stats, err := m.memoryCache.RecentStats(cinfo.Name, query.Start, query.End, query.NumStats)
if err != nil {
return nil, err
}
// Make a copy of the info for the user.
ret := &info.ContainerInfo{
ContainerReference: cinfo.ContainerReference,
Subcontainers: cinfo.Subcontainers,
Spec: m.getAdjustedSpec(cinfo),
Stats: stats,
}
return ret, nil
}
If the call GetInfo (shouldUpdateSubcontainers bool) function shouldUpdateSubcontainers parameter is set to true, The updateSpec() function is called on each request to read the cgroup data, which increases the pressure on kernsfs Lock.
Intro:
We call cadvisor subcontainers API to obtain the data of all cgroup containers. With the increase of QPS, the frequency of cgroup read will increase, which will aggravate the pressure of kernfs file system lock and even cause machine hang.
Question:
Do we need to read the cgroup less frequently when we call
GetInfo
to fetchContainerInfo
data by caching it?https://github.com/google/cadvisor/blob/54dff2b8ccb147747d814b0ff3b4a3256dc569c0/manager/manager.go#L543C19-L543C47
If the call
GetInfo (shouldUpdateSubcontainers bool)
functionshouldUpdateSubcontainers
parameter is set to true, TheupdateSpec()
function is called on each request to read the cgroup data, which increases the pressure on kernsfs Lock.The text was updated successfully, but these errors were encountered: