I've been facing an issue with Asterisk 13.11.2 on Debian 8 where it's crashing after reaching the limit of open files

bridge_channel.c: Can't create pipe! Try increasing max file descriptors with ulimit -n

I have managed to increase the limit from 65536 to 150000 using the /etc/security/limits.conf

I have added the following:

root soft nofile 150000
root hard nofile 150000
* soft nofile 150000
* hard nofile 150000

The result of ulimit -n is now 150000

When i try check the limit for the Asterisk process cat /proc/xxx/limits

I still get the old limit!

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             31945                31945                processes
Max open files            1024                 4096                 files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       31945                31945                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

How to solve this?

  • If you are using systemd, have a look at man systemd.exec or online. In case you are using a SysV script, just add the ulimit -n <your-number-here> to the top of your script.
    – Thomas
    Oct 4 '16 at 9:54
  • restart asterisk to make changes of ulimit available (for the new process) Oct 4 '16 at 12:47
  • @RomeoNinov I guess i didn't mention that I did restart the server for the changes to apply. Didn't work
    – TareKhoury
    Oct 4 '16 at 12:55
  • @TareKhoury is this 64 bit OS? And do you restart it by hand? Oct 4 '16 at 14:24

Uncomment and change the value of MAXFILES in /usr/sbin/safe_asterisk

ex: MAXFILES = 150000

save file and restart asterisk


  • /usr/sbin/safe_asterisk does not exactly sound like a file that is supposed to be edited. Note that these changes could be overwritten with the next upgrade of the Asterisk package. Jun 14 '20 at 22:50

I'm suspecting that your system is using systemd which ignores /etc/security/limits.conf. Instead you have to configure these limits in the asterisk service file (/etc/systemd/system/asterisk.service or /lib/systemd/system/asterisk.service). You probably want to add


Note that you probably don't want to edit the file that comes with Asterisk since you would run into the risk that your changes would be overwritten with the next Asterisk update. Instead I would recommend to create a file /etc/systemd/system/asterisk.d/10-file-descriptors.conf with the line above. Systemd will then automatically augment the official service file with your configuration.


Set following options in the asterisk.conf

internal_timing = no
maxfiles = 999999

Complete Solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.