1751976 Members
5139 Online
108784 Solutions
New Discussion юеВ

Re: file descriptor ?

 
SOLVED
Go to solution
Jerry L. Sims
Frequent Advisor

file descriptor ?

What is a file descriptor ? Users are asking
if they maxing out on file descriptors. Is there a kernel parm(s) that reflects file descriptors ?
6 REPLIES 6
Michael Tully
Honored Contributor
Solution

Re: file descriptor ?


The actual parameters your after are 'maxfiles' and 'maxfiles_lim'. These define 'hard' and 'soft'limits. The shell uses 'ulimit -a' to see the actual limit.

Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: file descriptor ?

Here is the kernel document. Happy reading ... (yawn)

http://www.docs.hp.com/hpux/onlinedocs/939/KCParms/KCparams.OverviewAll.html
Anyone for a Mutiny ?
Jerry L. Sims
Frequent Advisor

Re: file descriptor ?

Hello Tully,

Is there a way to tell if a user is getting close to that limit ?
nibble
Super Advisor

Re: file descriptor ?

c file descriptor 0 refers to standard input, usually keyboad (device file of kb)


c file descriptor 1 refers to standard output, usually the terminal (device file fo terminal)

c file descriptor 2 refers to standard error, the file to which the shell writes the error message.

Jerry L. Sims
Frequent Advisor

Re: file descriptor ?

The "ulimit -a" command delivered the following :
ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 0
nofiles(descriptors) 2048

The "2048" matches the "maxfiles & maxfiles_lim". Are these global values for all users? When I executed the "ulimit -a"
from a users ID it did not display the:
"nofiles(descriptors) 2048". How do I tell if a user gets anywhere near that limit?
A. Clay Stephenson
Acclaimed Contributor

Re: file descriptor ?

File descriptors are small integers in the range of 0-n. In the old days of UNIX, n was 19; then 63; and now its determined by the tunable maxfiles. This limits the number of file descriptor for a process. The global limit nfile limits the total number of open files. If 20 users have the same file open, that counts as 20 for nfile purposes. File descriptors are returned by the open(), pipe(), and creat() system calls. The are lower-level abstracts than their *FILE counterparts returned by fopen() and popen().
It is very important to note the errno set by the failing process (indicated by well-written programs by returning errno as $?). The result code will tell you which file limit you are hitting.

Man 2 open for details.
If it ain't broke, I can fix that.