Operating System - HP-UX
1833420 Members
3387 Online
110052 Solutions
New Discussion

Determine number of open files and/or open file locks

 
Alexander Skwar
Frequent Advisor

Determine number of open files and/or open file locks

Hello.

I'm trying to debug some program running on HP-UX 11i. In the application
log file, I got a lot of these messages:

*** warning: fork: no more processes - retrying

Well, it seems that something hit a limit here and I'm thinking that
it might be the number of open files (nfile) and/or the number of open
file locks (nflocks).

Is there some way, that I can find out how many open files there are
in the system and how many open file locks there are?

Thanks a lot,

Alexander Skwar
6 REPLIES 6
Chris Wilshaw
Honored Contributor

Re: Determine number of open files and/or open file locks

use

sar -v 1 5

To get the number of open files (look under the file-sz column).

You will have to install Glance (trial version on the application CD's is free) to look at the number of locks.
Massimo Bianchi
Honored Contributor

Re: Determine number of open files and/or open file locks

Hi,
check with SAM, or in /stand/system, and looks for parameters

maxuprc - maximum number of process per user
nflocks - number of file locks
nproc - maximum number of process - systemwide

You may need to adapt them.
Check current usage with
"sar -v 5 10"

Do not take into account ninode, it's just a cache and it will almost always be at 100%.

Regards,
Massimo
RAC_1
Honored Contributor

Re: Determine number of open files and/or open file locks

For nfile, do
glance -t
sar -v 5 5

For nflocks

lsof | awk 'match("NrRwWuUx",substr($0,31,1))'|wc -l

Anil
There is no substitute to HARDWORK
Alzhy
Honored Contributor

Re: Determine number of open files and/or open file locks

sar -v n count
Hakuna Matata.
A. Clay Stephenson
Acclaimed Contributor

Re: Determine number of open files and/or open file locks

The fork() system call can fail for a number of reasons including lack of swap space but
your is setting errno 11 - EAGAIN. That condition can be set for two reason and is one of the few examples of a system call failing and it is not possible to pinpoint the cause. You could be hotting nproc (system-wide process limit) or maxuprc (maximum number of processes for a sinfle users). Both set the same errno value.

Man 2 fork for more details.

sar -v will tell you the number of system-wide open files and I'm betting that nproc is too low.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Determine number of open files and/or open file locks

The fork() system call can fail for a number of reasons including lack of swap space but
yours is setting errno 11 - EAGAIN. That condition can be set for two reason and is one of the few examples of a system call failing and it is not possible to pinpoint the cause. You could be hotting nproc (system-wide process limit) or maxuprc (maximum number of processes for a sinfle users). Both set the same errno value.

Man 2 fork for more details.

sar -v will tell you the number of system-wide open files and I'm betting that nproc is too low.
If it ain't broke, I can fix that.