Skip to content

Commit 766f729

Browse files
committed
Reduce cgroups read frequency to avoid kernel kernfs clock pressure
Signed-off-by: xigang <[email protected]>
1 parent 255cff7 commit 766f729

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

manager/manager.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,10 @@ func (m *manager) GetContainerInfoV2(containerName string, options v2.RequestOpt
541541
}
542542

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

0 commit comments

Comments
 (0)