HPUX: number of open files - hp-hpux
This is a discussion on HPUX: number of open files - hp-hpux ; Hallo, I was looking some time for a good way to debug file handle related problems. Maybe somebody can help me with some questions I have (regarding HP-UX 11.* IA64): - for a running application (not shell) can I find ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| I was looking some time for a good way to debug file handle related problems. Maybe somebody can help me with some questions I have (regarding HP-UX 11.* IA64): - for a running application (not shell) can I find out what the process' soft and hard limits for number of files (and sockets I guess) is? - for a running application, can I actually read the number of used handles? (I only know the work around with lsof -p, but I am not sure how reliable I can get to the real count) Besides that I wonder if a process reaches the soft limit or the system wide nfile limit, is there a counter or log event I can monitor for? And finally, If I read the man pages right, the soft/hardlimit of a login session is defined by the kernel tunables maxfiles and maxfiles_lim and there is no project/group specific settings build into HPUX (unlike PAM/limits.conf for Linux or Projects for Solaris) Greetings Bernd -- http://itblog.eckenfels.net (german) |
|
#2
| |||
| |||
| bernd.eckenfels@googlemail.com wrote: > - for a running application (not shell) can I find out what the > process' soft and hard limits for number of files (and sockets I > guess) is? You can call getrlimit(2). Use RLIMIT_NOFILE. > - for a running application, can I actually read the number of used > handles? (I only know the work around with lsof -p, but I am not sure > how reliable I can get to the real count) I suppose you could use pstat_getfile2(2) to get a list of the files. > Besides that I wonder if a process reaches the soft limit or the > system wide nfile limit, is there a counter or log event I can monitor > for? For nfile, you can use: kcusage nfile > the soft/hardlimit of a > login session is defined by the kernel tunables maxfiles and > maxfiles_lim and there is no project/group specific settings built > into HP-UX Yes. Unless ulimit -n (POSIX shell only) is used to set them smaller, either in /etc/profile or ~/.profile. |
|
#3
| |||
| |||
|
Hello Dennis, thanks for your hints: On 10 Nov., 22:24, Dennis Handly > You can call getrlimit(2). *Use RLIMIT_NOFILE. Yes, but I want to do that from outside the application. I think I can get it to spawn a shell, so that would be the easiest. Just wondered if one could remote attach an debugger or have some /proc/ (like Linux). > For nfile, you can use: kcusage nfile Very good, found that. I guess with 11i it is dynamic/unlimited usually anyway. Greetings Bernd PS: why is ksh not supporting the NOFILE, isnt that one of the more important resource limits? |
|
#4
| |||
| |||
| bernd.eckenfels@googlemail.com wrote: > Hallo, > > I was looking some time for a good way to debug file handle related > problems. Maybe somebody can help me with some questions I have > (regarding HP-UX 11.* IA64): > > - for a running application (not shell) can I find out what the > process' soft and hard limits for number of files (and sockets I > guess) is? > > - for a running application, can I actually read the number of used > handles? (I only know the work around with lsof -p, but I am not sure > how reliable I can get to the real count) Don't know for HP-UX. Solaris has pfiles. > > Besides that I wonder if a process reaches the soft limit or the > system wide nfile limit, is there a counter or log event I can monitor > for? syslog file, HP-UX normally has /var/adm/syslog/syslog.log > > And finally, If I read the man pages right, the soft/hardlimit of a > login session is defined by the kernel tunables maxfiles and > maxfiles_lim and there is no project/group specific settings build > into HPUX (unlike PAM/limits.conf for Linux or Projects for Solaris) > These limits belong to the process environment, so Unix inheritance takes place. A shell spawned from your application is a child, and can give nothing to its parent (only to its children). But a shell wrapper like this will do it: #!/bin/sh ulimit -n 512 exec /path/to/application "$@" -- echo imhcea\.lophc.tcs.hmo | sed 's2\(....\)\(.\{5\}\)2\2\122;s1\(.\)\(.\)1\2\11g;1 s;\.;::;2' |
|
#5
| |||
| |||
|
Bernd Eckenfels wrote: > but I want to do that from outside the application. Do what? Get the limit? The limit is normally the same for everyone. Get how many files currently open? pstat_getfile2(2) > if one could remote attach an debugger I'm not sure what a debugger could tell you. > PS: why is ksh not supporting the NOFILE, isn't that one of the more > important resource limits? No, I would expect the data size to be more important. And ksh has always been johnny come lately with uname. |
|
#6
| |||
| |||
|
On 11 Nov., 23:48, Dennis Handly > Bernd Eckenfels wrote: > > but I want to do that from outside the application. > > Do what? *Get the limit? *The limit is normally the same for everyone.. > Get how many files currently open? *pstat_getfile2(2) Yes, get the current soft limit and the list for a running process (from externally). pstat_getfile2looks good, maybe pstat_getproc can give me the limits (dont have access to the include file right now). I would have preferred to have a command for that... Greetings Bernd |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 07:59 PM.




Linear Mode