Operating System - HP-UX
1820623 Members
1874 Online
109626 Solutions
New Discussion юеВ

Re: Too Many Open Files error message

 
yn_wangchao163.com
Occasional Advisor

Too Many Open Files error message

Hi,
I received some error message at syslog.log file.

sshd[6409]: error: openpty: Too many open files
sshd[6412]: error: session_pty_req: session 2 alloc failed
sshd[6412]: error: session_pty_req: session 1 alloc failed
sshd[6412]: error: session_pty_req: session 3 alloc failed
sshd[6409]: error: chown 0 0 failed: No such file or directory
sshd[6409]: error: chmod 0666 failed: No such file or directory
sshd[6409]: error: openpty: Too many open files
above message repeats 2 times
19 REPLIES 19
Steven E. Protter
Exalted Contributor

Re: Too Many Open Files error message

Shalom,

This would indicate a need to change some kernel parameters:

nfile
maxuprc


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Johnson Punniyalingam
Honored Contributor

Re: Too Many Open Files error message

you need to tune 'maxfiles' kernal parameter and 'maxfiles_lim'. Check out the manpage.

what OS HPUX version.?

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Steven E. Protter
Exalted Contributor

Re: Too Many Open Files error message

I agree with the follow on post to mine.

I recommend sam kernel configuration configurable parameters for those who are new with the OS. Sam is replaced with SMH in the 11.31 OS.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Venkatesh BL
Honored Contributor

Re: Too Many Open Files error message

You may also want to see if the application is opening files and not closing them (due to a bug)...
Avinash20
Honored Contributor

Re: Too Many Open Files error message

At the same time you could check the output of

# sar -v 1 5

This will let us know if the number of files are getting filled, and if the kernel parameters needs to be increased.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Kapil Jha
Honored Contributor

Re: Too Many Open Files error message

Is this a new server or this problem came suddenly , if this came suddently and nothing was upgraded in server......no application, no DB etc.
Then you have to see which process is opening so many files(if you have lsof it can help you a lot in that).

And if this issue come after any upgrade then you have have to incrase above suggested parameter inclusing the need of that new application.

Don go and change kernel parameter at one instance you gotta see why that happened.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

Thanks everyone:
I saw maxuprc = 3780 by smh,but I can not find this parameter nfile. My os is HP-UX 11.31.
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

# sar -v 1 5

HP-UX pmsdb1 B.11.31 U ia64 03/11/09

09:08:32 text-sz ov proc-sz ov inod-sz ov file-sz ov
09:08:33 N/A N/A 502/4200 0 1484/35648 0 8480/2147483647 0
09:08:34 N/A N/A 505/4200 0 1488/35648 0 8482/2147483647 0
09:08:35 N/A N/A 502/4200 0 1495/35648 0 8480/2147483647 0
09:08:36 N/A N/A 503/4200 0 1484/35648 0 8483/2147483647 0
09:08:37 N/A N/A 503/4200 0 1485/35648 0 8484/2147483647 0
Dennis Handly
Acclaimed Contributor

Re: Too Many Open Files error message

>I can not find this parameter nfile.

nfile is no longer there on 11.31, so don't worry about it. That was the case where there were too many open files for ALL of the processes, not just the per process limit maxfiles_lim.
http://docs.hp.com/en/B2355-60130/nfile.5.html
Dennis Handly
Acclaimed Contributor

Re: Too Many Open Files error message

I forgot to mention since you are on 11.31, you can use pfiles(1) to see how many open files there are for that sshd PID 6409, if still there:
pfiles 6409
щ╗ЮчЗГ
Valued Contributor

Re: Too Many Open Files error message

please check how many users are logged in to the server through ssh etc and the number of Pseudo Terminals (npty) being used.

You can check this from 'glance'.
Go to glance and press 't' for the system tables report.
If there are any inactive sessions, kill them.

Regards!
Man's mind, once stretched by a new idea, never regains its original dimensions
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

Thanks,
I saw a very large nfile(2147483647) by glance.
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

System Table Available Used Utilization High(%)
--------------------------------------------------------------------------------
Proc Table (nproc) 4200 533 13 13
File Table (nfile) 2147483647 6371 0 0
Shared Mem Table (shmmni) 512 16 3 3
Message Table (msgmni) 4200 2 0 0
Semaphore Table (semmni) 8400 30 0 0
File Locks (nflocks) 4200 81 2 2
Pseudo Terminals (npty) 60 0 0 0
Buffer Headers (nbuf) na 11936 na na
Dennis Handly
Acclaimed Contributor

Re: Too Many Open Files error message

On my 11.31, nfile is 0, so I guess you can ignore it.

What is the value of maxfiles_lim and have you tried pfiles(1)?
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

maxfiles_lim=4096
Johnson Punniyalingam
Honored Contributor

Re: Too Many Open Files error message

how about macfile..?

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
yn_wangchao163.com
Occasional Advisor

Re: Too Many Open Files error message

Thanks,
maxfiles=2048
Johnson Punniyalingam
Honored Contributor

Re: Too Many Open Files error message

looks ok to me.

# maxfile = 2048
# maxfiles_lim =4096

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: Too Many Open Files error message

you try increasing the "parameter" has suggested earlier.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference