Hi all, 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: WARN connection/_accept_connection accept() failed with error 24: Too many open files Tried these configs and reboot, it won't work! /etc/pam.d/common-session session required pam_limits.so /etc/sysctl.conf fs.file-max = 100000 /etc/icecast2/icecast.xml <clients>20000</clients> # open file limit /etc/security/limits.conf icecast2 hard nofile 90000 icecast2 soft nofile 50000 icecast2 hard nproc 90000 icecast2 soft nproc 50000 How do I know? ps aux | grep icecast2 cat /proc/ICECAST2_PID/limits max open file is still 1024 In the end, I have to add the following line to /etc/init.d/icecast2 ulimit -n 20000 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 # Check if the ULIMIT is set in /etc/default/icecast2 if [ -n "$ULIMIT" ]; then # Set the ulimits ulimit $ULIMIT fi And add a /etc/default/icecast2 with the following sample config # Example: ULIMIT="-n 4096" #ULIMIT="-n 4096" I steal these from Nginx config! Anyway, what I am saying is that we need a config file to deal with this issue! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast-dev/attachments/20160920/21d41e27/attachment.html>
On 20 Sep 2016, at 3:10, Chen Wei Hsu wrote:> Hi all, > > 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: > > WARN connection/_accept_connection accept() failed with error 24: Too > many > open files > > Tried these configs and reboot, it won't work! > /etc/pam.d/common-session > session required pam_limits.so > > /etc/sysctl.conf > fs.file-max = 100000 > > /etc/icecast2/icecast.xml > <clients>20000</clients> > > # open file limit > /etc/security/limits.conf > icecast2 hard nofile 90000 > icecast2 soft nofile 50000 > icecast2 hard nproc 90000 > icecast2 soft nproc 50000 > > How do I know? > ps aux | grep icecast2 > cat /proc/ICECAST2_PID/limits > max open file is still 1024 > > In the end, I have to add the following line to /etc/init.d/icecast2 > > ulimit -n 20000 > > 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/icecast2The mentioned file /etc/init.d/icecast2 is packaging specific, not part of the Icecast software and not really a "config file".> > # Check if the ULIMIT is set in /etc/default/icecast2 > if [ -n "$ULIMIT" ]; then > # Set the ulimits > ulimit $ULIMIT > fi > > And add a /etc/default/icecast2 with the following sample config > > # Example: ULIMIT="-n 4096" > #ULIMIT="-n 4096" > > I steal these from Nginx config! Anyway, what I am saying is that we > need a > config file to deal with this issue!I do not think that Icecast needs/should deal with it, it can easily be changed if necessary by the server admin and Icecast should not interfere with this.
Hi Chen You explained the problem and gave us a reasonable solution for it. Thanks for that.> > 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: > > > > WARN connection/_accept_connection accept() failed with error 24: > > Too many > > open files[...]> > In the end, I have to add the following line to /etc/init.d/icecast2 > > > > ulimit -n 20000 > > > > 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 > > The mentioned file /etc/init.d/icecast2 is packaging specific, not > part of the > Icecast software and not really a "config file".As Marvin sad, your solution is distribution specific. So you could try to send your fix to the package maintainers of Ubuntu or Debian (it's most likely that Ubuntu reuses the Debian package without modification). For the Debian package you can report it here: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=icecast2> > > > # Check if the ULIMIT is set in /etc/default/icecast2 > > if [ -n "$ULIMIT" ]; then > > # Set the ulimits > > ulimit $ULIMIT > > fi > > > > And add a /etc/default/icecast2 with the following sample config > > > > # Example: ULIMIT="-n 4096" > > #ULIMIT="-n 4096" > > > > I steal these from Nginx config! Anyway, what I am saying is that > > we need a > > config file to deal with this issue! > > I do not think that Icecast needs/should deal with it, it can easily > be changed > if necessary by the server admin and Icecast should not interfere > with this.Yes, the solution is easy but I guess Chen spent several ours finding the correct solution (as he explained, he tried different methods). A note in the documentation or somewhere else could be helpful. --- Christoph
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. m. On 8 października 2016 at 11:37:59, Chen Wei Hsu (cwhsu1984 at gmail.com) wrote: Hi all, 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: WARN connection/_accept_connection accept() failed with error 24: Too many open files Tried these configs and reboot, it won't work! /etc/pam.d/common-session session required pam_limits.so /etc/sysctl.conf fs.file-max = 100000 /etc/icecast2/icecast.xml <clients>20000</clients> # open file limit /etc/security/limits.conf icecast2 hard nofile 90000 icecast2 soft nofile 50000 icecast2 hard nproc 90000 icecast2 soft nproc 50000 How do I know? ps aux | grep icecast2 cat /proc/ICECAST2_PID/limits max open file is still 1024 In the end, I have to add the following line to /etc/init.d/icecast2 ulimit -n 20000 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 # Check if the ULIMIT is set in /etc/default/icecast2 if [ -n "$ULIMIT" ]; then # Set the ulimits ulimit $ULIMIT fi And add a /etc/default/icecast2 with the following sample config # Example: ULIMIT="-n 4096" #ULIMIT="-n 4096" I steal these from Nginx config! Anyway, what I am saying is that we need a config file to deal with this issue! _______________________________________________ Icecast-dev mailing list Icecast-dev at xiph.org http://lists.xiph.org/mailman/listinfo/icecast-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast-dev/attachments/20161008/0e1d0030/attachment.html>
Hi, 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! 2016-10-09 4:58 GMT+08:00 Marcin Lewandowski <marcin at saepia.net>:> 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. > > m. > > > > On 8 października 2016 at 11:37:59, Chen Wei Hsu (cwhsu1984 at gmail.com) > wrote: > > Hi all, > > 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: > > WARN connection/_accept_connection accept() failed with error 24: Too many > open files > > Tried these configs and reboot, it won't work! > /etc/pam.d/common-session > session required pam_limits.so > > /etc/sysctl.conf > fs.file-max = 100000 > > /etc/icecast2/icecast.xml > <clients>20000</clients> > > # open file limit > /etc/security/limits.conf > icecast2 hard nofile 90000 > icecast2 soft nofile 50000 > icecast2 hard nproc 90000 > icecast2 soft nproc 50000 > > How do I know? > ps aux | grep icecast2 > cat /proc/ICECAST2_PID/limits > max open file is still 1024 > > In the end, I have to add the following line to /etc/init.d/icecast2 > > ulimit -n 20000 > > 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 > > # Check if the ULIMIT is set in /etc/default/icecast2 > if [ -n "$ULIMIT" ]; then > # Set the ulimits > ulimit $ULIMIT > fi > > And add a /etc/default/icecast2 with the following sample config > > # Example: ULIMIT="-n 4096" > #ULIMIT="-n 4096" > > I steal these from Nginx config! Anyway, what I am saying is that we need > a config file to deal with this issue! > _______________________________________________ > Icecast-dev mailing list > Icecast-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast-dev/attachments/20161017/f32fbe96/attachment.html>