- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- open files by process or user id
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
06-05-2002 06:24 AM
06-05-2002 06:24 AM
Is there any way to find out which process or user is opening maximum files ?
We are watching this growing number from glance. More we can check using glance going to process and find out the how many file that process has opened.
But in our case we have nfile=60000, we need some good way to find this out.
We recently downloaded lsof and tried to use it but don't have good experience yet.
Thanks,
Kishor
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 06:26 AM
06-05-2002 06:26 AM
Re: open files by process or user id
Download and use lsof.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 06:29 AM
06-05-2002 06:29 AM
Re: open files by process or user id
Download it from:
http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/
Execute this:
# lsof | grep $PROCESS_NAME
That should show you the opened files by the $PROCESS_NAME (substitute appropriately).
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 06:32 AM
06-05-2002 06:32 AM
Re: open files by process or user id
Download and install "lsof" from this link,
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 06:36 AM
06-05-2002 06:36 AM
SolutionIf you want to count the number of files opened by each process, you can use the following:
# for i in `lsof | awk '{print $1}' | sort | uniq` ; do echo $i ; lsof | grep $i | grep '/' | wc -l ; done
apmd
6
atd
10
awk
0
bash
81
bdflush
3
COMMAND
0
crond
13
dhcpcd
14
gpm
9
httpd
594
init
20
kapm-idle
3
keventd
3
khubd
3
kjournald
15
klogd
7
kreclaimd
3
ksoftirqd
3
kswapd
3
kupdated
3
login
54
lsof
14
mdrecover
3
mingetty
32
mysqld
64
nessusd
32
safe_mysq
23
sleep
23
smbmount
10
sort
0
sshd
106
syslogd
18
uniq
0
xfs
17
This works with the grep for '/' because only opened files have full pathnames (containing /).
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 06:36 AM
06-05-2002 06:36 AM
Re: open files by process or user id
lsof | grep process name will list the no of files opened by that process , genrally do a sar -v 2 10 periodically every 5 mts and send the o/p to a log file , we had this problem and the one or the other process use to die we increased the nfile from 50000 to 100000 and then to 200000 and once in a week it this paramter saturates to 151000 , so either monitor using sar -v , or increase it by 50% and then monitor it , either way sar -v every 5 mts in cron should help you , bcoz even if you knw that the process has n no fo file open you will ahve to bump the nfile parameter.
Manoj Srivastava