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

Thread check types #959

Merged
merged 1 commit into from May 5, 2016
Merged

Thread check types #959

merged 1 commit into from May 5, 2016

Conversation

ssalinas
Copy link
Member

Although cgroup isolation is common, posix is the default. If we are not using cgroup isolation we will not find a cpu cgroup to parse and this will error every time. This PR does a few things:

  • Make two types of thread checks, CGROUP and PSTREE
  • Configurably fall back to PSTREE when CGROUP fails (defaults to false)

/fixes #741

@ssalinas ssalinas modified the milestone: 0.4.12 Mar 18, 2016
@tpetr
Copy link
Contributor

tpetr commented Mar 21, 2016

I like the idea of removing the cgroups requirement for thread limiting, but our original pstree implementation wasn't great. For example:

$ pstree 91309 -p
daemon-runner(91309)───su(91330)───daemon-runner(91338)─┬─python2.6(91408)
                                                        ├─tee(91339)
                                                        └─tee(91340)

The thread checker would conclude that process 91309 is using 3 threads, when it's really using 6. Are there any other UNIX facilities we can use to figure out the thread count? Do we know what pstree is using under the hood in order to generate this info?

@ssalinas
Copy link
Member Author

Good, point. Let me look and see what else we could use.

@ssalinas
Copy link
Member Author

Updated to have three possible thread checking types:

  • cgroup
  • ps
  • /proc//status

You can now configure the primary (defaults to cgroup) and a fallback (optional). If the fallback is set, it will be used in the case that the primary type does not result in a valid value

@ssalinas ssalinas added the hs_qa label Mar 21, 2016
@ssalinas ssalinas changed the title Thread check fallback Thread check types Mar 24, 2016
@ssalinas ssalinas modified the milestones: 0.5.0, 0.6.0 Apr 5, 2016
@ssalinas ssalinas merged commit 42f88f3 into master May 5, 2016
@ssalinas ssalinas deleted the thread_check_fallback branch May 5, 2016 14:10
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.

Failed to parse cgroup information
2 participants