<div dir="ltr">Hi,<div><br><div>Okey, I understand now that this is an OS related issue not an issue of Icecast, Still, it would be great if user could find some hints or notices in the Icecast documentation. Anyway, thank you all for the reply!</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-09 4:58 GMT+08:00 Marcin Lewandowski <span dir="ltr"><<a href="mailto:marcin@saepia.net" target="_blank">marcin@saepia.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div id="m_-1345909445980218464bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">It all looks like a workarounds. I would suggest using a proper solution, such as systemd, that is present in ubuntu 16.04 by default, and where you can raise system limits per system service just by tweaking its config file.</div><span class="HOEnZb"><font color="#888888"><div id="m_-1345909445980218464bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="m_-1345909445980218464bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">m.</div></font></span><div><div class="h5"> <br> <div id="m_-1345909445980218464bloop_sign_1475960273982116096" class="m_-1345909445980218464bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><br></div></div> <br><p class="m_-1345909445980218464airmail_on">On 8 października 2016 at 11:37:59, Chen Wei Hsu (<a href="mailto:cwhsu1984@gmail.com" target="_blank">cwhsu1984@gmail.com</a>) wrote:</p> </div></div><blockquote type="cite" class="m_-1345909445980218464clean_bq"><span><div><div></div><div><div><div class="h5">
<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></div></div><span class="">
______________________________<wbr>_________________<br>Icecast-dev mailing list<br><a href="mailto:Icecast-dev@xiph.org" target="_blank">Icecast-dev@xiph.org</a><br><a href="http://lists.xiph.org/mailman/listinfo/icecast-dev" target="_blank">http://lists.xiph.org/mailman/<wbr>listinfo/icecast-dev</a><br></span></div></div></span></blockquote></div>
</blockquote></div><br></div>