- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Report number of open files per process
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 02:33 AM
04-08-2003 02:33 AM
The number of open files in my system is pretty high and I do not understand why.
I would like to get a report with all processes and the total number of opened files for each process. Like this I can see in the top of the list the processes that are having the higher number of opened files.
I used glance to check the total number of opened files and to see the processes that take most of the CPU time. However the process having most of CPU does not necessarily has the highest number of files open. So glance is not solving my problem.... unless there is a screen/option I did not discover.
Probably a better option would be to use lsof but I could not manage to make it work the way I want it.
Thanks for any hint you can give me!
Florin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 02:41 AM
04-08-2003 02:41 AM
Re: Report number of open files per process
you can use lsof to list open files of a process
http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.64/
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 02:43 AM
04-08-2003 02:43 AM
Re: Report number of open files per process
As you mentioned, the lsof utility is the best tool for what you need. Here is a recent thread about the question of matching the nfile parameter in the kernel to the number of open files reported by lsof:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x973f28c64656d71190080090279cd0f9,00.html
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 02:46 AM
04-08-2003 02:46 AM
Re: Report number of open files per process
Why not...
Here iam finding out the number of open files by httpd process.
#lsof | grep httpd | grep -vi listen | wc -l
192
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 02:53 AM
04-08-2003 02:53 AM
Re: Report number of open files per process
yes lsof is the best tool as mentioned. For open files per single process within glance look at -F option
glance -F
enter PID (3476)
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 03:05 AM
04-08-2003 03:05 AM
Solutionthis would help to get the number of files open per process with lsof's output -
lsof | awk '{procct[$1]++;procname[$1]=$1;}END{for (i in procname) {printf ("%s, %d\n",procname[i],procct[i]);}}'
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 03:10 AM
04-08-2003 03:10 AM
Re: Report number of open files per process
Here's a script to better use lsof
lsof | awk '{line[NR]=$1}
END {
count=0
for (i=2 ; i <=NR ; i++)
{
if (line[i] != line [i-1])
{printf("%s %s\n",count, line[i-1])
count=1}
else
{count++
}
}
}' | sort -n
Chris