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

lsof - long runtime #71

Open
PeterPitterling opened this issue Nov 4, 2024 · 1 comment
Open

lsof - long runtime #71

PeterPitterling opened this issue Nov 4, 2024 · 1 comment

Comments

@PeterPitterling
Copy link

runtime on a large system for lsof exceeds 15 minutes.

# time lsof -M -P -n

real    15m17.660s
user    1m45.943s
sys     4m19.078s

In the past I often use the -c switch to reduce runtime

# time lsof -M -P -n -c ''

real    0m1.740s
user    0m0.175s
sys     0m0.692s

Would this switch still provide the required information for LinuxKI?

@MarkCRay
Copy link
Contributor

MarkCRay commented Dec 5, 2024

Thanks for the suggestion. For large multi-threaded applications, this would really help. I'll change the lsof command to the following:

$ lsof -M -P -n -K i

The -K i option is just a bit more direct and documented way to ignore threads based of the lsof manpage:

If -K is followed by a value, k, it must be "i". That causes lsof to ignore tasks, particularly in the default, list-everything case when no other options are specified.

I have made the change on my local copy and it will be fixed in the next LinuxKI release.

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

No branches or pull requests

2 participants