LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-21-2021, 03:59 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
Open desc. count by app and faster method to discover used count than lsof?


Hello,

i am wondering how to quickly discover currently used desc. more quickly than using lsof which is too slow.

cat /proc/sys/fs/file-max
...quintillion high number here...

ulimit -Sn
1024

ulimit -Hn
90000

grep nofile /etc/security/limits.conf
# - nofile - max number of 0pen file descript0rs
* hard nofile 900000

$ cat /proc/sys/fs/file-nr
36480 0 quintillion_high_value_here

$ sudo ls -l /proc/*/fd|sort -h|grep -v total|wc -l
18970

lsof|wc -l
1591966

and correct location to modify the limit is likely that limits.conf file on Arch? and btw any clever command or script to output top descript0r usage apps with the count of desc. used by these? I have found only this one. Thank you

Last edited by postcd; 09-21-2021 at 06:55 AM.
 
Old 09-21-2021, 09:57 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,363
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
I doubt seriously that you will find a faster method than lsof.

Also, please surround any terminal output with "code" tags which become available when you click the "Advanced" button beneath the compose/edit post window. It makes terminal output much easier to read.
 
Old 09-22-2021, 08:19 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,712

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by postcd View Post
Hello,
i am wondering how to quickly discover currently used desc. more quickly than using lsof which is too slow.
First question would be WHY is it 'too slow', followed by what are you actually trying to accomplish with this??
Quote:
Code:
cat /proc/sys/fs/file-max
...quintillion high number here...

ulimit -Sn
1024

ulimit -Hn
90000

grep nofile /etc/security/limits.conf
#        - nofile - max number of 0pen file descript0rs
*		 hard	 nofile		 900000

$ cat /proc/sys/fs/file-nr
36480 0 quintillion_high_value_here

$ sudo ls -l /proc/*/fd|sort -h|grep -v total|wc -l
18970

lsof|wc -l
1591966
and correct location to modify the limit is likely that limits.conf file on Arch?
Did you try putting "how to modify open file descriptors on arch linux" into Google?? Reading the first hit?
https://wiki.archlinux.org/title/Limits.conf
Quote:
and btw any clever command or script to output top descript0r usage apps with the count of desc. used by these? I have found only this one. Thank you
That's a good one...you can also write your own. But again, you don't say what you're trying to accomplish/do, or what version/distro of Linux (only can assume arch) you're using. Since you (again) don't clearly state what you're trying to accomplish or provide details, the best you can get is a generic answer.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an e-mail if lsof count exceeds a certain value. threezerous Linux - Newbie 1 10-03-2011 09:23 AM
Slackpkg and slack-desc Panci Slackware 9 04-05-2009 06:15 AM
LXer: Firefox 3 Beta 4 is 5x faster than IE7, 3x faster than FF2 LXer Syndicated Linux News 0 03-12-2008 05:50 PM
package creation and slack-desc file mobilemonkey Slackware 6 07-02-2007 10:53 AM
Makepkg and slack-desc mirto Slackware 7 10-15-2005 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration