Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce cgroups read frequency to avoid kernel kernfs clock pressure #3633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xigang
Copy link

@xigang xigang commented Dec 8, 2024

Fixes ##3528

When GetInfo is called with false parameter, it now reads cgroups data once every 5 seconds and gets data from containerData cache at other times. This change reduces the frequency of reading cgroups to prevent potential Linux
machine hangs caused by kernel kernfs clock pressure.

The change affects the containerDataToContainerInfo method in manager.go which is used to retrieve container information. By caching and reusing the cgroups data between reads, we reduce system load while still maintaining
reasonably up-to-date container metrics.

@xigang
Copy link
Author

xigang commented Dec 8, 2024

/cc @dims @iwankgb @cwangVT PTAL.

@dims
Copy link
Collaborator

dims commented Dec 9, 2024

/ok-to-test

@xigang
Copy link
Author

xigang commented Dec 9, 2024

@dims Please run the workflow pipeline again, thanks.

# go test -v -run TestGetContainerInfo
=== RUN   TestGetContainerInfo
--- PASS: TestGetContainerInfo (0.00s)
=== RUN   TestGetContainerInfoV2
--- PASS: TestGetContainerInfoV2 (0.00s)
=== RUN   TestGetContainerInfoV2Failure
--- PASS: TestGetContainerInfoV2Failure (0.00s)
PASS
ok  	github.com/google/cadvisor/manager	0.010s

@xigang
Copy link
Author

xigang commented Dec 10, 2024

/retest

@xigang
Copy link
Author

xigang commented Dec 10, 2024

/cc @iwankgb Is there an issue with this workflow? It runs fine on my local setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants