Increase file ulimit for the asterisk daemon

You could always edit the /etc/init.d/asterisk file and prepend ulimit -n 2048 to the top.

This is the same process that MySQL, Varnish and a few others use.


For Asterisk running under systemd (e.g. on Debian 9), you need to create a systemd override file:

mkdir /etc/systemd/system/asterisk.service.d/

Create /etc/systemd/system/asterisk.service.d/override.conf with the following contents:

[Service]
LimitNOFILE=100000

Reload the unit:

systemctl daemon-reload

Restart Asterisk:

systemctl restart astertisk

Check the limit:

cat /proc/<your asterisk PID>/limits | grep '^Max open files'

I had this exact issue for anyone stumbling across this in the future (is it chrome?)

The system that I was having the issue on was Debian rather than Ubuntu, but hey, close enough.

I had to use the following in '/etc/security/limits.conf' to get it working, as specifying the user & group didn't work.

*               soft    nofile          10240
*               hard    nofile          10240

Logging in and out again applies this change.

Tags:

Linux

Ulimit