<div dir="ltr"><div>Hi all,</div><div><br></div><div>I am trying to stream for over 1k users on Ubuntu 16.04. I notice that when stream connection is over 1024, it get warning like this:</div><div><br></div>WARN connection/_accept_connection accept() failed with error 24: Too many open files<br><div><br></div><div>Tried these configs and reboot, it won't work!</div><div><div>/etc/pam.d/common-session</div><div>session required pam_limits.so</div><div><br></div><div>/etc/sysctl.conf</div><div>fs.file-max = 100000</div><div><br></div><div>/etc/icecast2/icecast.xml<br></div><div><clients>20000</clients></div><div><br></div><div># open file limit</div><div>/etc/security/limits.conf</div><div>icecast2 hard nofile 90000</div><div>icecast2 soft nofile 50000</div><div>icecast2 hard nproc 90000</div><div>icecast2 soft nproc 50000</div></div><div><br></div><div>How do I know?</div><div>ps aux | grep icecast2</div><div>cat /proc/ICECAST2_PID/limits</div><div>max open file is still 1024</div><div><br></div><div>In the end, I have to add the following line to /etc/init.d/icecast2</div><div><div><br></div><div>ulimit -n 20000</div></div><div><br></div><div>And I can stream over 1k users now. There is no config about ulimit for icecast2, and therefore, I suggest that we add something like this in /etc/init.d/icecast2</div><div><br></div><div><div># Check if the ULIMIT is set in /etc/default/icecast2</div><div>if [ -n "$ULIMIT" ]; then</div><div>        # Set the ulimits</div><div>        ulimit $ULIMIT</div><div>fi</div></div><div><br></div><div>And add a /etc/default/icecast2 with the following sample config</div><div><br></div><div><div>#  Example: ULIMIT="-n 4096"</div><div>#ULIMIT="-n 4096"</div></div><div><br></div><div>I steal these from Nginx config! Anyway, what I am saying is that we need a config file to deal with this issue!</div></div>