0

I'm running an Icecast 2.4.3 server on a CentOS 7. When I have a lot of listeners, I receive these errors and everything stops working:

[2017-06-21  18:56:37] WARN connection/_accept_connection accept() failed with error 24: Too many open files

It's running on "ices" user:

sudo -u ices /opt/icecast/bin/icecast -c /opt/icecast/etc/icecast.xml -b

Or running as root with "changeowner" option to "ices" user.

I set limits.conf:

ices         hard    nofile      65536
ices         soft    nofile      65536

From ulimit:

[root@orfeu inweb]# su ices
[ices@orfeu inweb]$ ulimit -n
65536

But when I check the PID, I get:

tcp        0      0 <IP>:8000       0.0.0.0:*               LISTEN      21650/icecast

[root@orfeu inweb]# cat /proc/21650/limits
Limit                     Soft Limit           Hard Limit           Units
...
Max open files            1024                 4096                 files
...

How can I fix this, to enforce 65536 file descriptors? Thank you.

Arvy
  • 1,072
  • 2
  • 16
  • 29
  • The name is Icecast. No CamelCase. JFTR – TBR Jun 22 '17 at 06:54
  • 1
    It seems you built things from source and are struggling with starting things properly. I'd recommend to use the EPEL package of Icecast. It should come with a systemd service and there you can then also set the limits properly. It's up to date. (2.4.3 was a windows only release, 2.4.2 is latest on Unix/Linux) – TBR Jun 22 '17 at 06:57
  • I cant find icecast2 on CentOS7, even with EPEL installed. I did from source. – Arvy Jun 23 '17 at 00:16
  • 1
    http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/epel/7/x86_64/i/ – TBR Jun 23 '17 at 05:16

1 Answers1

0

Probably I found a solution. Need to check when the problem happens again.

I realize that limits.conf set the limits per user. I found out a way to set the limits per process.

/usr/bin/prlimit -n30000 -p `cat /var/run/icecast.pid`

Now I have:

Max open files            30000                30000                files

I don't know if there's a way to always start "icecast" binary with these limits, or always need to run the command against the PID after run.

Arvy
  • 1,072
  • 2
  • 16
  • 29
  • 1
    I'd just use `ulimit` as part of the start script to set the desired value and then execute Icecast. – TBR Jun 22 '17 at 06:55