[asterisk-users] Too many open files, asterisk crash
Matthew J. Roth
mroth at imminc.com
Fri Apr 27 10:11:26 MST 2007
Rilawich Ango wrote:
> Thanks for your reply.
You're welcome. = )
> What I ready do is:
> add ulimit -n 65535 in safe_asterisk
> increase value to 203380 in /proc/sys/fs/file-max
I don't think it can cause any problems, but I've never had to adjust
anything in the /proc filesystem, and I'm administering a pretty busy
server:
# date; asterisk -rx "show channels" | grep active
Fri Apr 27 12:55:44 EDT 2007
574 active channels
412 of 1000 max active calls (41.20% of capacity)
> Both actions don't help much for the file descriptor growing.
It's possible that your version of Asterisk is leaking file
descriptors. Have you checked out the issue tracker at
<http://bugs.digium.com> to see if it's a known issue? For perspective,
Asterisk is currently using 2,260 file descriptors on my system.
# ls -l /proc/`cat /var/run/asterisk.pid`/fd/ | wc -l
2260
> Do I need to reboot if I insert the following in /etc/security?
> * - nofile 65535
I don't *think* a reboot should be necessary, but since limits.conf
applies to login shells you should logout and log back in. Note that
while the '*' is documented as a wildcard for the domain, my copy of
limits.conf doesn't mention using a '-' as the type:
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
> Can I identify or remove the file descriptors, which are unused, shown
> in lsof?
>
> Can I reload some modules to reduce the unused file descriptor instead
> of restart?
Once you properly configure your ulimits and restart Asterisk from a
fresh login, you shouldn't have to take any additional steps. If you
continue to have problems and the number of file descriptors has
actually exceeded 65,535, it's probably time to file a bug report.
Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer
More information about the asterisk-users
mailing list