[asterisk-users] asterisk freeze due to "too many open file" error

Gordon Henderson gordon+asterisk at drogon.net
Thu Feb 15 10:00:46 MST 2007


On Thu, 15 Feb 2007, Giorgio Incantalupo wrote:

> Hi Tzafrir,
> it was the only solution. I had to kill Asterisk and restart it. I've got 
> many PBX installed but this is the first time it happened. I've searched for 
> some opened file limit in linux but found nothing and "ulimit" says 
> "unlimited".

Unlimited is unlimited for the process currently running - ie. the process 
that you type the 'ulimit' command into.

If you start asterisk as a user different from the one you are typing the 
commands into (eg. is it started as the user 'asterisk' rather than root?) 
then the limits _could_ be different, depending on how your system deals 
with this sort of thing. (PAM, or other subsystems)

And in any case, there is an upper system limit set by the kernel. Try 
this:

   cat /proc/sys/fs/file-max

This is set at boot time and is generally dependant on how much memory you 
have. You can change this number if required, but it usually isn't.

You may also want to look at /proc/sys/fs/file-nr - the first number is 
the number of open files in the whole system.

If the system is "running away" then I'd suggest looking deeper into it - 
is it opening a file and never closing it again, etc. Hard to track down 
unless you have a good knowlege of what's running, etc.

Gordon


More information about the asterisk-users mailing list