Operating System - HP-UX
1748104 Members
4593 Online
108758 Solutions
New Discussion юеВ

maxfiles_lim, open files not appearing to close

 
SOLVED
Go to solution
Todd McDaniel_1
Honored Contributor

maxfiles_lim, open files not appearing to close

All,

I have a strange problem, My maxfiles_lim is set at 1024. My DBAs are suddenly having a problem with this file limit. I increased it to 4096 with no problems, but they had me reduce it back to 1024 so they could trouble shoot their application.

Im not really sure how to describe this problem. I think the best way is to quote my DBA and hopefully you can help. Basically we are hitting the maxfiles_lim ceiling and they are curious why files that show closed are still being counted against the parm.

quote:

I am trying to understand the coorelation between the glance and truss on the topic of "open" files. Glance showed an ever-increasing list of open file descriptors, maxing out at 523 open file descriptors for PID 12857. I am most interested in the file named /usr/.../8.1.7.4.64/rdbms/mesg/oraus.msb which is listed 496 times. Truss showed this file being opened 496 times but it also showed it being closed 496 times. If the FDs are being closed, then why does HP-UX / Glance count that against the process and against the maxfiles_lim ? Is maxfiles_lim supposed to apply to any file that has been opened by the process or just "open" files? Is glance (F) supposed to display any file that has been opened by the process or just "open" files?

unquote...

Any help you can provide me would be excellent as I have no expertise in this area.



Unix, the other white meat.
4 REPLIES 4
Michael Steele_2
Honored Contributor
Solution

Re: maxfiles_lim, open files not appearing to close

Do a search on your server for 'lsof'. Its usually under /usr/local/sbin. Here's a download if needed:

http://hpux.cict.fr/hppd/hpux/Sysadmin/lsof-4.64/

Have your DBA's try:

# lsof -p pid

...to observe what's not being cleaned up.
Support Fatherhood - Stop Family Law
Todd McDaniel_1
Honored Contributor

Re: maxfiles_lim, open files not appearing to close

yes I do have lsof loaded. I will suggest that to them.
Unix, the other white meat.
A. Clay Stephenson
Acclaimed Contributor

Re: maxfiles_lim, open files not appearing to close

Maxfile_lim only applies to files that are currently open. Suppose maxfiles_lim were set artifically low , say 20. Thousands of files could still be opened by a single process just never more than 20 concurrently. By the way, opening the same physical file 3 times concurrently counts as three not one. You also need to bear in mind that files remain open across fork()'s and exec()'s unless the close-on-exec flag is set.

In the "Good Old Days" of UNIX, 20 was the hard-coded limit and could not be exceeded. When it was changed to 64, we thought we were in hog-heaven. For a long time after the increase to the terrific limit of 64, you still could only use 20 *FILES (those using fopen(), fwrite(), gets(), fclose()) because the libC routines still were coded around the limit of 20. For anything above 20 your only option were the lower-level file desctriptor system calls ( open(), read(), write(), close() ).
If it ain't broke, I can fix that.
Todd McDaniel_1
Honored Contributor

Re: maxfiles_lim, open files not appearing to close

Thanks, Clay.

I REALLY need to read and memm the descriptions of each kernel parm and learn what they influence, well at least the top 20 anyway.

Unix, the other white meat.