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

Collect nropen for each process to monitor if fd leaks #218

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

Conversation

ShirleyFei
Copy link
Contributor

This patch collects and displays the current number of opened file descriptors for each process to monitor if fd leaks. As each thread has the same fds with its process, there is no need to collect each thread's fd numbers then.

Considering users may set the nr_open limit to a very large number, we use getdents[64] SYSCALL directly to get fd numbers instead of glibc's readdir() for performance consideration.

Also, define MAX_OPEN to be 1024 * 1024 for display even if the fd numbers may exceed 1024 * 1024.

Signed-off-by: Fei Li lifei.shirley@bytedance.com

This patch collects and displays the current number of opened file
descriptors for each process to monitor if fd leaks. As each thread
has the same fds with its process, there is no need to collect each
thread's fd numbers then.

Considering users may set the nr_open limit to a very large number,
we regard MAX_OPEN to be 10000 to avoid further performance
degradation.

Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
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.

1 participant