Too many open files?

Hi,

I have recently inherited responsibility of our internal Asterisk server after the person who used to administer it has left us. I do not know much about Asterisk and just my luck, the server decided to fail.

I am receiving the following two errors on the console, repeated 100+ times per second:

Sep 14 14:03:37 WARNING[9452]: rtp.c:845 ast_rtp_new_with_bindaddr: Unable to allocate socket: Too many open files
Sep 14 14:03:37 WARNING[9452]: chan_sip.c:2305 sip_alloc: Unable to create RTP session: Too many open files

Can anyone help me understand what this means and how I can fix it?

Some additional info: This is running on RedHad 2.6.9 and has been in production for 6+ years without issues.

The symptoms are that all calls, inbound, outbound, and internal, don’t work. Sometimes, immediately after restarting the Asterisk service, a few calls make it through, but they are short lived and within 1-2 minutes they stop again (though the Asterisk service continues to run).

When running the application outside of service mode (asterisk -vvvc) the process terminates with the following (after many of those same warnings).

Sep 14 14:28:27 WARNING[10340]: rtp.c:845 ast_rtp_new_with_bindaddr: Unable to allocate socket: Too many open files
Sep 14 14:28:27 WARNING[10340]: chan_sip.c:2305 sip_alloc: Unable to create RTP session: Too many open files
app_qcall:Cannot open queue directory: Too many open files
libgcc_s.so.1 must be installed for pthread_cancel to work
Ouch … error while writing audio data: : Broken pipe
Ouch … error while writing audio data: : Broken pipe
Aborted
[root@servername ~]#

ulimit -n (help ulimit at shell prompt) is too small for the number of simultaneous calls, or you have a file descriptor leak. The latter is unlikely, if it has been working for so many years before.

Official support for such an old Asterisk will have ceased some years ago.

Thanks for the response. Turns out the server was under attack by some Chinese IP address, making several hundred SIP requests per second. Blocked the IP with IPTABLES and all returned to normal.

Thanks.