1825723 Members
2860 Online
109687 Solutions
New Discussion

nfile count

 

nfile count

Hi All
The nfile count on one of my N Class servers seems to be continually increasing. Does anyone know what could be causing this problem? Are there any tools that can track down what process is causing this?
6 REPLIES 6
Jean-Luc Oudart
Honored Contributor

Re: nfile count

Have you got "lsof" installed on your system ?

Rgds,
JL
fiat lux

Re: nfile count

Yes - I downloaded it because I had the impression that it may be able to help. It seems quite comprehensive with many flags - do you know what ones I should use to try and isolate what process is increasing the nfile count out of control?
Hari Kumar
Trusted Contributor

Re: nfile count

nfile is system-wide open files limit,
as formula based it depends upon nproc,maxusers,npty,nstrpty,nstrtel also.
That can be due to increase in users, number of processess and opened files.
Information is Wealth ; Knowledge is Power
Tom Danzig
Honored Contributor

Re: nfile count

It's possible that a process is opening and not closing files. YOu should be able to track it down with lsof.

You could have a cron run every hour or so and run something like:

#!/usr/bin/sh
date >> /tmp/lsof.log
lsof | sort >> /tmp/lsof.log


Look for a particular process in which the number of open files continuously grows.
Bill Hassell
Honored Contributor

Re: nfile count

There is NOTHING wrong with your system. You are probably running more processes (sar -v 1, look at the proc column) and/or the processes are opening more files. If you stop allowing anyone from logging in and stop all user processes, your nfile usage will drop drastically and never grow. So the question is: are your user logins doing what you expect?

It is not unusual to require tens of thousands of files to be open at the same time (might be the same file though...nfile is a list of all open files). The average open file count is 5-25 per process so if nproc allows 500 processes, then nfile should be 2500 to 125,000. IN some large server applications with thousands of logins, I have seen nproc=20,000 and nfile=800,000 with about 70% usage in both tables. HP-UX is very scalable.


Bill Hassell, sysadmin