Operating System - HP-UX
1833764 Members
2300 Online
110063 Solutions
New Discussion

Relationship of 'nfile' to Memory

 
SOLVED
Go to solution
Michael Steele_2
Honored Contributor

Relationship of 'nfile' to Memory

Hi:

The 'nfile' kernel parameter has been dynamic since I believe 11.00 and 64 bit CPU's. Not important. Somewhere around the intro of 11.00 the kernel parameter 'nfile' sent from static to dynamic and increased it's max value depending upon how much memory you had in your box.

I am looking for this relationship in some kind of formula or format like, for 1 GB max nfile is 1000. For 2 GB max nfile is 10,000.

Etc.

Does anyone have a citation or reference on this?

Thanks in Advance.!
Support Fatherhood - Stop Family Law
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor
Solution

Re: Relationship of 'nfile' to Memory

Hi:

The manpages for 'nfile(5)' tell the story.

From the 11.23 manpages: "For small memory systems (less than 1GB), the default is 16384, or 16K. For systems with more than 1GB of memory, the default is 65536, or 64K...The minimum value allowed is 2048. The maximum value allowed is the maximum 32-bit signed integer value that can be represented in the system. The value is further constrained in that it must be equal to or greater than two times the per-process open file hard limit: (nfile >= 2*maxfiles_lim)."

At 11.31, the manpages note, "The default value for nfile is 0 (zero). The value of zero means that the system limit usually enforced by nfile will be disabled (that is, the number of system-wide open files is limited only by available memory)."

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Relationship of 'nfile' to Memory

On 11.31, this parm is obsolete since it is totally dynamic.
Michael Steele_2
Honored Contributor

Re: Relationship of 'nfile' to Memory

Thanks. I've got an 11.23 box where 'nfile' continues to grow. Over 6 weeks there is steady growth with only 4 or 5 dips in total nfile during this 6 week time.

I am thinking:

a) open files are not been closed by the application and there may be a code issue.

And I'm looking for concurrence from the Forum or another reason for open files never being released back to the system.

Don't see anything else odd including no memory leaks.

Question: Will 'nfile' max out in 11.23?
Support Fatherhood - Stop Family Law
Patrick Wallek
Honored Contributor

Re: Relationship of 'nfile' to Memory

>>Question: Will 'nfile' max out in 11.23?

Yes, it definitely should.

What is the count of open files you see vs. your current nfile value? What does the 'file-sz' column look like in 'sar -v'?
James R. Ferguson
Acclaimed Contributor

Re: Relationship of 'nfile' to Memory

Hi (again) Michael:

> Question: Will 'nfile' max out in 11.23?

Yes, at the setting specified in your kernel. Dynamic means that you can change the parameter value immediately without a reboot.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Relationship of 'nfile' to Memory

>a) open files are not been closed by the application and there may be a code issue.

Have you used glance or lsof to check to see what files are open for your suspect applications?
Michael Steele_2
Honored Contributor

Re: Relationship of 'nfile' to Memory

Agreed.

But wouldn't you speculate that there is a code problem not closing open files?
Support Fatherhood - Stop Family Law
Dennis Handly
Acclaimed Contributor

Re: Relationship of 'nfile' to Memory

>wouldn't you speculate that there is a code problem not closing open files?

Exactly, provided the number of processes is constant. (Files includes sockets, etc.)
VK2COT
Honored Contributor

Re: Relationship of 'nfile' to Memory

Hello,

One additional word of caution:

Do not change nfile on HP-UX 11i v3!

Whilst it used to be very popular to change
it on older HP-UX releases, having non-zero
value on HP-UX 11i v3 can cause dramatical
problems, as few of our Oracle customers
experienced.

They preserved the values of nfile from HP-UX
11i v2 and the DB was having huge problems
and crashes.

Leave nfile on HP-UX 11i v3 as default.
It fact, it is now a PRIVATE KERNEL PARAMETER.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Michael Steele_2
Honored Contributor

Re: Relationship of 'nfile' to Memory

VK2COT:

See Dennis' reply above and man page for 11.31 nfile. (* The default is 0 since nfile is dynamic in 11.31 *)
Support Fatherhood - Stop Family Law