| View previous topic :: View next topic |
| Author |
Message |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Sat Apr 19, 2008 2:09 pm Post subject: Hard error "Too many open files" |
|
|
Hey guys,
I have icecast working fine, but today I had a crazy problem.
Configured a mountpoint to 3000 Clients and Icecast-global to 3100 Client.
When the server had about 1014 clients icecast didnt accept more listeners.
In the logfile are many lines like that (everytime a listener tries to connect):
| Quote: |
| WARN connection/_accept_connection accept() failed with error 24: Too many open files |
running icecast 2.3.1
Thank you,
Kai |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sat Apr 19, 2008 3:15 pm Post subject: |
|
|
The OS will define a per process limit for file descriptors which has typically been around 1024 on unix systems. The difference being handles for log files, YP etc. To allow more you have to check what limits the OS define. The ulimit command can be used to see what limits are currently set for you but the usual setting to alter is nofile in the /etc/security/limits.conf file.
karl. |
|
| Back to top |
|
 |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Sat Apr 19, 2008 7:22 pm Post subject: |
|
|
ok cool thank you.
I wrote
| Quote: |
icecast2 hard nofile 10000
icecast2 soft nofile 10000 |
Do you know how I can check if it works when iam logged in as root (icecast2 has no shell-login and ulimit shows only my own values)?
Kai |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Apr 20, 2008 1:41 am Post subject: |
|
|
The value is reported in the -kh branch but I wasn't sure why well supported it is across the different platforms so it's not in trunk.
Here I can look at the setting in the /proc/<pid>/limits file
karl. |
|
| Back to top |
|
 |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Sun Apr 20, 2008 7:07 am Post subject: |
|
|
in my debian there is no /proc(<pid>/limits file  |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Apr 20, 2008 2:29 pm Post subject: |
|
|
as a workaround, you could run a shell script which starts icecast but before it does report the ulimit settings to a file. I can merge the log line that reports the limit at startup, most systems should support it and if not then it just won't log it.
karl. |
|
| Back to top |
|
 |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Sun Apr 20, 2008 9:12 pm Post subject: |
|
|
that would be cool...
i am using an init.d script to start icecast... maybe it could report?
Kai |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Apr 20, 2008 9:48 pm Post subject: |
|
|
yes, just get the script to dump the ulimit output to a file before icecast is started up
karl. |
|
| Back to top |
|
 |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Mon Apr 21, 2008 4:41 am Post subject: |
|
|
u know how to do?
Because of the scrips will called by root and uchanged to icecast2/icecast in parameter of start-stop-demon....
Kai |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Apr 21, 2008 5:35 am Post subject: |
|
|
not without seeing the scripts in question. At some point there needs to be an something that calls icecast with some args.
karl. |
|
| Back to top |
|
 |
kai4711
Joined: 21 Nov 2007 Posts: 30
|
Posted: Mon Apr 21, 2008 11:34 am Post subject: |
|
|
| Quote: |
#! /bin/sh
#
# icecast2
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Further modified by Keegan Quinn <ice@thebasement.org>
# for use with Icecast 2
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2
NAME=icecast2
DESC=icecast2
test -x $DAEMON || exit 0
# Defaults
CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE="false"
# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE
if [ "$ENABLE" != "true" ]; then
echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
exit 0
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--exec $DAEMON -- -b -c $CONFIGFILE
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
echo "$NAME."
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--exec $DAEMON -- -b -c $CONFIGFILE
echo "$NAME."
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
|
|
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Apr 21, 2008 12:55 pm Post subject: |
|
|
Look in the other files for the start-stop-daemon function. remember the only thing you need to do is run ulimit before the daemon is run and then manually start icecast up
karl. |
|
| Back to top |
|
 |
|