Skip to content

Conversation

@dashpole
Copy link
Collaborator

@dashpole dashpole commented Jun 13, 2018

We already don't collect metrics on .mount cgroups. But watching each of the mount cgroups for sub-cgroups can use up all of the inotify watches on the node. This change now makes the watcher ignore .mount cgroups.

@dashpole
Copy link
Collaborator Author

I tested this by adding a log line right before we add an inotify watch. I verified that before this change, we see .mount cgroups being watched. After the change, we no longer see .mount cgroups being watched.

@yujuhong
Copy link
Contributor

I think this is the right thing to do since watching those cgroups exhausts node resources easily.
/lgtm

/cc @derekwaynecarr

// Watches the specified directory and all subdirectories. Returns whether the path was
// already being watched and an error (if any).
func (self *rawContainerWatcher) watchDirectory(events chan watcher.ContainerEvent, dir string, containerName string) (bool, error) {
if strings.HasSuffix(containerName, ".mount") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a comment explaining why :-)

@dashpole
Copy link
Collaborator Author

/retest

@dashpole dashpole merged commit 198bf16 into google:master Jun 14, 2018
@dashpole dashpole deleted the dont_watch_mount branch June 14, 2018 17:39
dashpole added a commit that referenced this pull request Jun 21, 2018
dashpole added a commit that referenced this pull request Jun 21, 2018
dashpole added a commit that referenced this pull request Jun 21, 2018
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