FD 32767 exceeds the maximum size of ast_fdset!

Hi Experts,

I’m trying to load test 500 calls on my asterisk server 1.8 and the asterisk cli stopped showing any messages. When i quit the CLI and run it again by this command “asterisk -rvvvvvvvvgc” an error message is showing. It says “FD 32767 exceeds the maximum size of ast_fdset!

I can resolve the issue when I restart the server.

Here are the things I did for the load test.

  1. Installed SIPp on a different server.
  2. Modified the ulimit of the Asterisk Server.
    • ulimit -n 65535
  3. Modified the ulimit in the init script so that it will change the ulimit of the asterisk also.
    • nano /etc/init.d/asterisk
      added: ulimit -n 65535
  4. confirmed if it’s working by this command: "cat /proc/pidof asterisk/limits "
    root@asterlui:~# cat /proc/pidof asterisk/limits
    Limit Soft Limit Hard Limit Units
    Max cpu time unlimited unlimited seconds
    Max file size unlimited unlimited bytes
    Max data size unlimited unlimited bytes
    Max stack size 8388608 unlimited bytes
    Max core file size 0 unlimited bytes
    Max resident set unlimited unlimited bytes
    Max processes 16135 16135 processes
    Max open files 65536 65536 files
    Max locked memory 65536 65536 bytes
    Max address space unlimited unlimited bytes
    Max file locks unlimited unlimited locks
    Max pending signals 16135 16135 signals
    Max msgqueue size 819200 819200 bytes
    Max nice priority 0 0
    Max realtime priority 0 0
    Max realtime timeout unlimited unlimited us
    root@asterlui:~# ulimit -n
  5. run Sipp command on a different server to test. “sipp -sn uac -d 20000 -s 5000 192.168.300.22 -l 5”
  6. After 300 calls, the messages on the CLI stopped. When I quit the CLI and run an instance of “asterisk -rvv”, the error appears.

I appreciate any help…


File descriptors are allocated on a first fit basis, so I presume you have a file descriptor leak, or are leaking some other resource that uses file descriptors.

If there is something about your application that really needs 32767+ file descriptors, I would suggest that you are making unreasonable demands on the OS, even if it will support more. Early Unix only had 20 per process! Do you possibly have more channels awaiting their purge timer than actually up?


Thanks for replying. I increased the file descriptors so that I can know the limit of my server by using SIPP. I want to know how many calls can it handle.