Skip to content

Commit

Permalink
Reduce cgroups read frequency to avoid kernel kernfs clock pressure
Browse files Browse the repository at this point in the history
Signed-off-by: xigang <[email protected]>
  • Loading branch information
xigang committed Dec 8, 2024
1 parent 255cff7 commit 766f729
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ func (m *manager) GetContainerInfoV2(containerName string, options v2.RequestOpt
}

func (m *manager) containerDataToContainerInfo(cont *containerData, query *info.ContainerInfoRequest) (*info.ContainerInfo, error) {
// Get the info from the container.
cinfo, err := cont.GetInfo(true)
// Get the info from the container. When GetInfo is set to false,
// it reads cgroups once every 5 seconds and gets data from containerData cache at other times,
// reducing the frequency of reading cgroups to avoid kernel kernfs clock pressure that could cause Linux machine to hang
cinfo, err := cont.GetInfo(false)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 766f729

Please sign in to comment.