Operating System - HP-UX
1834166 Members
2876 Online
110064 Solutions
New Discussion

Re: How to monitor maxfiles parameter on HP-UX 11.0

 
Andy Miller_4
Advisor

How to monitor maxfiles parameter on HP-UX 11.0

Hi there,

We are experiencing a problem whereby we are seeing 'too many open files' message in /var/adm/syslog/syslog.log

We have spoken to our software application company and evidently the problem is being caused by the client version that we are using being incompatible with the version of RPC and thus is chews up our maxfiles.
The have said that it is a known problem between the client version and HP-UX 11.0 and they have informed us of a couple of OS patches that we are looking in to at the moment.

maxfiles is set to 2048
we are running HP-UX 11.0

In the mean time, does anyone know how we can monitor the maxfiles so we can predict when it is about to blow please ?

Many thanks,

Sean
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

Pete Randall
Outstanding Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

Sean,

If you have Glance, it will monitor nfile using the System Tables Report, but I don't know of a way to monitor maxfiles.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

You can highlight a particular process in Glance and look at it's maxfiles. That may give you what you need.


Pete

Pete
Bill Hassell
Honored Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

maxfiles has nothing to do (directly) with the total number of open files on the system, so you don't 'blow' the maxfiles parameter. maxfiles is a simple fence, typically set to 60 so that bad programs that go crazy and try to repeatedly open the same file or different files will be terminated before they use up all the available files for the system. Many applications tell you to configure maxfiles to 2048 (and also set maxfiles_lim=2048) which makes no sense. If the program truly needs 2048 (or more files) it will make a system call to setrlimit() to change the maximum number of files that this specific program needs. Any programmer that doesn't do this needs to go back to UNIX-101 class.

Of course, there is a another question: why does this program need 2048 files opened at the same time???? Now if there is a valid reason, DON'T set maxfiles to 2048. Instead, set maxfiles to 60 or so, and then (because the program won't do this) use the ulimit -n command to set the required number of files for this program. Put this into a startup script for the program. NOTE: ulimit -n is only available in HP-UX POSIX shell. maxfiles is a soft limit and can be modified with setrlimit() or ulimit -n.

Now if the program needs more than 2048 files (again, ask why), then change maxfiles_lim which is a hard limit for all programs. If the program needs 6000 files open at the same time, then set maxfiles_lim=6000 and use ulimit -n to set the maxfiles value for the program.

Now all of this assumes that you are NOT running out of system-wide open files. This is controlled by nfile and can be seen with sar -v 1. If nfile is too small, limiting maxfiles won't help because the program will simply crash. nfile has no practical bounds, so if it is set to 4000, then you can't run 2 copies of a programs that opens 2048 files. Note also that network ports are also counted in the file list. If you need to run 100 copies of this program, then nfile needs to be set to more than 204,800 perhaps 220,000. syslog.log will tell you if you've exceeded the kernel's file table with messages: file: table is full


Bill Hassell, sysadmin
Andy Miller_4
Advisor

Re: How to monitor maxfiles parameter on HP-UX 11.0

Thanks for all the replies so far,

After speaking to our vendors for the application that we run, they have said that it is a compatibility between the client software version and the server software causing open files to be left open, thus ramping up the maxfiles and then causing us to have to stop/restart the application.

The have said that it is a known problem and is addressed by patches PHNE_23833 & PKNE_23456 which will allow these files to be released as previously occured.
Isaac C. Hamilton
Occasional Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

Andy,
If you write a script that uses sar -v you can monitor the number of files open and the kernal parm associated. I have several that I use if you are interested send me an email and I will send you a copy. linnbi01@unisourcelink.com
William
Raj D.
Honored Contributor

Re: How to monitor maxfiles parameter on HP-UX 11.0

Hi Andy,

check ,
1.
# sar -v 5 5

and check for the parameter "file-sz" , and it will tell how many file you can open ,and current , and its nothing but nfile kernel parameter. And you can monitor it ,

2.
Also check
# glance -t [ Will show system table usage.]

hope this will help ..

Cheers ,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "