Operating System - HP-UX
1825750 Members
2829 Online
109687 Solutions
New Discussion

Number of open files and file locks

 
Bernardo Pastorelli
Occasional Advisor

Number of open files and file locks

On HP-UX 11.11 I'm experiencing problems with the number of file locks (nflocks) configured in the kernel. During the boot the system reaches the maximum number and some operations fail with ENOLCK.
Using kmtune I displayed both nfile and nflocks and they have reached the value 8196 (that is the maximum for my system). Using:
lsof | wc
only 1775 files seems to be open.
What I'm doing wrong? Why kmtune reports 8196 open files (and 8196 file locks) while only 1775 are reported by lsof?
If lsof is not the rigth tool, which one can I use to display all the active file locks and which process owns them?
7 REPLIES 7
Yogeeraj_1
Honored Contributor

Re: Number of open files and file locks

hi,

try monitoring using Glance Plus.

You will have a more detailed report.

Hth
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Bernardo Pastorelli
Occasional Advisor

Re: Number of open files and file locks

Searching the HP site my understanding is that GlancePlus is a separately priced product. Is it correct?
If not, where can I download GlancePLus. It seems it is not installed on my machine.

Thanks,
Bernardo
Pete Randall
Outstanding Contributor

Re: Number of open files and file locks

Bernardo,

You should be able to find a 30 (or is it 60?) day trial version of Glance on your application CD's.


Pete

Pete
Kent Ostby
Honored Contributor

Re: Number of open files and file locks

Bernardo --

Has anything changed on the system ? Increased load, new software, etc ?

Various software packages (Samba, Microfocus Cobol, etc) can put additional stress onto the system in the area of nflocks.

Applications that lock at a record level may create more then one lock per file.

Given that nflock is a "cheap" variable (i.e. it only takes 104 bytes worth of space) to allocate, I would multiply your current value by 1.5 ro 2* (e.g. set it to 12294 or 16392) and see if this fixes the problem.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Ross Zubritski
Trusted Contributor

Re: Number of open files and file locks

Install the 60 day glance trial. Run glance and type "t". This will alow you to monitor critical system tables in real time.

Regards,

RZ
Bill Hassell
Honored Contributor

Re: Number of open files and file locks

kmtune reports on the size of nfile and nflocks but not the usage. sar -v 1 will report on the current and max values for nfile. Only Glance can show you nflocks. NOTE: It is quite normal to need more locks than open files since a file may have several locks in different areas (record locks) from different programs.

The max size for nflocks is dependent on the application requirements. You may need to double or triple nflocks. Beyond that, I would be very suspicious of the programs using so many locks and talk to the programmer(s).


Bill Hassell, sysadmin
Bernardo Pastorelli
Occasional Advisor

Re: Number of open files and file locks

Running glance (System Tables Report) in a shell I tried from another shell to load my kernel module. The kmadmin -L command fails with message:
"kmadmin: module: No locks available"
But glance reports:
nflocks 18 used out of 8196
nfile 638 used out of 8202

Also, the message displayed by kmadmin is correct: the system call to load the module fails with errno ENOLCK.

At this point I'm quite confused. Why kmadmin fails because of a locks shortage while there are thousands of locks available?