- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to check how many files are opened by the proc...
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
09-06-2005 11:48 PM
09-06-2005 11:48 PM
smp1 # sysdef | grep nfile
nfile 12418 - 14- -
smp1 # sar -v | more
HP-UX smp1 B.11.00 U 9000/800 09/06/05
00:00:00 text-sz ov proc-sz ov inod-sz ov file-sz ov
00:01:00 N/A N/A 279/2068 0 1925/2492 0 12196/12418 0
Do you know how check the number of files opened by the particular process
Thanks and regards,
W.F.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:52 PM
09-06-2005 11:52 PM
Re: how to check how many files are opened by the process
lsof -p
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:53 PM
09-06-2005 11:53 PM
Re: how to check how many files are opened by the process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:58 PM
09-06-2005 11:58 PM
Re: how to check how many files are opened by the process
You can use lsof
#lsof -p
You can find this utility like more others on
http://hpux.connect.org.uk/
Regards,
Borislav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 12:09 AM
09-07-2005 12:09 AM
Re: how to check how many files are opened by the process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 12:18 AM
09-07-2005 12:18 AM
Re: how to check how many files are opened by the process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 12:22 AM
09-07-2005 12:22 AM
Re: how to check how many files are opened by the process
dbxxx:/# lsof -p 2855 (telnetd)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
telnetd 2855 root cwd VDIR 64,0x3 1024 2 /
telnetd 2855 root txt VREG 64,0x6 94208 16671 /usr (/dev/vg00/lvol6)
telnetd 2855 root mem VREG 64,0x6 20480 2518 /usr/lib/libnss_dns.1
telnetd 2855 root mem VREG 64,0x6 40960 2809 /usr/lib/libnss_files.1
telnetd 2855 root mem VREG 64,0x6 942080 2816 /usr/lib/libsis.sl
telnetd 2855 root mem VREG 64,0x6 24576 2836 /usr/lib/libdld.2
telnetd 2855 root mem VREG 64,0x6 1568768 2814 /usr/lib/libc.2
telnetd 2855 root mem VREG 64,0x6 241664 2711 /usr/lib/dld.sl
telnetd 2855 root mem VREG 64,0x7 532 34952 /var/spool/pwgr/status
telnetd 2855 root 0u inet 0x41e32e68 0t0 TCP dbxxx:telnet->daf00067.intern:1516 (ESTABLISHED)
telnetd 2855 root 1u inet 0x41e32e68 0t0 TCP dbxxx:telnet->daf00067.intern:1516 (ESTABLISHED)
telnetd 2855 root 2u inet 0x41e32e68 0t0 TCP db001:telnet->daf00067.intern:1516 (ESTABLISHED)
telnetd 2855 root 3u VCHR 138,0 0t98 6967 pckt->telm
telnetd 2855 root 4u unix 0x4204a200 0t0 /var/spool/sockets/pwgr/
client2855
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 12:23 AM
09-07-2005 12:23 AM
Re: how to check how many files are opened by the process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 12:52 AM
09-07-2005 12:52 AM
SolutionTherefore, I would suspect that some application program is opening hundreds of files at the same time. To narrow down the choices, sort the processes by memory used:
UNIX95= ps -e -o vsz,pid,ruser,args|sort -rn|head -20
This sorts the processes by memory used. Now run lsof against the largest processes. That may identify the process(es) that use a large number of files. It's also possible that some processes are opening a large nunmber of network sockets. Run the command netstat to see if this is the case.
Now all of this is probably quite normal for the applications. You can set nfile to 50,000 or even 250,000. This is a parameter that makes room for a open files and if your applications need lots of files, this is a very normal task for the system administrator. On the other hand, if you have developers writing programs and they have made errors in coding, then a bad program might needlessly open a large number of files. In that case, you can limit these problem programs using maxfiles and maxfiles_lim. Set maxfiles to about 100 and maxfiles_lim to 2048, then see what programs fail to operate correctly. Then for those programs that are known to be working as designed, use the ulimit -Sn command in the shell to temporarily raise the limit for this one program (or programs).
nproc and nfile can be extremely large if needed, so adjust them as required once possible problem programs have been corrected.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 01:15 AM
09-07-2005 01:15 AM
Re: how to check how many files are opened by the process
for the number of open files for a process consult lsof or glance
to search for processes with lots of open files use the quick&dirty:
lsof | grep " /" | awk '{pl[$2]++} END {for (a in pl) {printf("%d: %d\n", a, pl[a])}}'
this will show the pid and the open files (if the contain a " /".....
(better than nothing ;-))
Micky