View Full Version : freebsd or debian OS?
blueicegr
14th November 2004, 20:03
Hi,
i am interest to provide shoutcast hosting.
The last 5 years i am admin in linux-freebsd servers.
I have setup shoutcast in 2 test servers. One with debian and one with freebsd.
Both servers have the same hardware specs (celeron 2.2G).
I have see that the freebsd use about 4-5% of cpu per soutcast server. This is for 0 listeners. (until 3 listeners it is the same).
in debian use 0-0.1% of cpu.
Can everyone inform me if this is normal? So it is better to use debian?
Why the freebsd use so mere CPU?
Can (some admins) someone inform me if it is more stable in freebsd or in debian?
Thanks for the answers
Christos
blueicegr
15th November 2004, 05:59
So? any help?
There no freebsd admins here?
MegaRock
15th November 2004, 06:15
Dunno which is more stable - never had a problem with running SC on FreeBSD. The only thing I can look at for guidance is the BSD strain of Linux was recently rated as one of the most secure OS's on the planet and that's good enough for me to stick with it.
blueicegr
15th November 2004, 06:58
Originally posted by MegaRock
Dunno which is more stable - never had a problem with running SC on FreeBSD. The only thing I can look at for guidance is the BSD strain of Linux was recently rated as one of the most secure OS's on the planet and that's good enough for me to stick with it.
Thanks for your answer.
I know how i can secure debian so this is not a prob.
I have see that every sc server in freebsd use 3-4% of cpu (even and with 1 listener).
This happen and in your server? I use freebsd 4.10 in a celeron 2.2G box.
In linux i see cpu usage 0-0.10% per sc.
Can you please give me more info about this?
Thanks,
Regards,
Christos
paz21
15th November 2004, 07:22
It seems they did something wrong while porting it to FreeBSD.
I tried linux binary on FreeBSD-5(old, debug code enabled version, not upgraded to -stable yet).
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
shoutcast 27218 3.5 0.6 4028 3076 p7 S Fri12PM 157:47.62 ./sc_serv conf/ad.conf
shoutcast 82255 0.0 0.4 12528 2296 p7 S 5:14PM 0:00.06 ./sc_serv_linux conf/test.conf
shoutcast 82256 0.0 0.4 12528 2296 p7 S 5:14PM 0:00.00 ./sc_serv_linux conf/test.conf
shoutcast 82257 0.0 0.4 12528 2296 p7 S 5:14PM 0:00.11 ./sc_serv_linux conf/test.conf
shoutcast 82258 0.0 0.4 12528 2296 p7 R 5:14PM 0:00.22 ./sc_serv_linux conf/test.conf
shoutcast 82259 0.0 0.4 12528 2296 p7 S 5:14PM 0:00.11 ./sc_serv_linux conf/test.conf
shoutcast 82260 0.0 0.4 12528 2296 p7 S 5:14PM 0:00.00 ./sc_serv_linux conf/test.confad.conf and test.conf is identical except listening port and PublicServer. also theres only 1 user listening, since ad.conf is relay-relay(not for listener)
sc_serv_linux appearing 6 times is normal(thread)
I think I'm gonna switch my relays to linux binary.. :)
(of course after stability testing.. but i used to run rather complex applications with linux emulation, so i dont expect trouble..)
btw, above ps result is taken from Athlon 700Mhz, my main relay on Cel950(FreeBSD5) use 5~6% at 50~90/250 user(with 128Kbps) and 3~4% at 0~5/200 24Kbps.
derelictwhirl
15th November 2004, 07:50
freebsd5 is more robust to handle a large number of connections.
so, it may look faster in linux when the server is idle, but when you'll get 5000 or even 500 connections, it will be the other way around.
paz21
15th November 2004, 08:52
Originally posted by derelictwhirl
freebsd5 is more robust to handle a large number of connections.
so, it may look faster in linux when the server is idle, but when you'll get 5000 or even 500 connections, it will be the other way around.
Usually, I'm on side of advocating FreeBSD.. BUT that 'FreeBSD has better network code and works better in heavy load' and such .. has ended with linux kernel 2.6.
Generally, its on par. (it still works little better in heavy load tho..)
And you don't seem to know what you talking about.
5000 listener * 24Kbps = over 100Mbps,
5000 listener * 128Kbps = 650+Mbps including overhead.
You can achieve 650Mbps on Gig-E without lots of trouble these days when you transfer big files OR testing network performance. but without good(expensive) equipments, you are NOT going to get 650Mbps with lots of small pipes(5000 listeners).
anyway.. back to topic, I switched my main relay to shoutcast-1-9-4-linux-glibc6 on FreeBSD5 with linux emulation(with linux_base-8-8.0_4).. lets see how it does with some listeners.
blueicegr
15th November 2004, 12:57
Originally posted by derelictwhirl
freebsd5 is more robust to handle a large number of connections.
so, it may look faster in linux when the server is idle, but when you'll get 5000 or even 500 connections, it will be the other way around.
You think tha tit is normal to use more that 3% CPU withoun any source and listener?
I hope some small bug have make this problem.
I try to find older versions of shoutcast and i post my comments.
Christos
blueicegr
15th November 2004, 13:13
I have check the versions 1.8.9 & 1.9.2
Both have the same problem in freebsd.
Can some freebsd admins explain this?
I have read that the developers recomended freebsd mre from linux. So how can explained this big cpu usage?
Christos
paz21
15th November 2004, 14:50
Originally posted by blueicegr
I have check the versions 1.8.9 & 1.9.2
Both have the same problem in freebsd.
Can some freebsd admins explain this?
I have read that the developers recomended freebsd mre from linux. So how can explained this big cpu usage?
Christos
That's program flaw, not an OS issue.
otherwise you'd get same result from emulated linux binary... since linux emulator is just wrapper of system calls.
btw, using linux binary, its using around 2.98~3.5% cpu on Cel950 with 80~90 concurrent user. with freebsd binary, it was 5~6% at about 60 user and 3~4% with idling server.
blueicegr
15th November 2004, 15:19
Originally posted by paz21
That's program flaw, not an OS issue.
otherwise you'd get same result from emulated linux binary... since linux emulator is just wrapper of system calls.
btw, using linux binary, its using around 2.98~3.5% cpu on Cel950 with 80~90 concurrent user. with freebsd binary, it was 5~6% at about 60 user and 3~4% with idling server.
I hope i have find tha problem with big CPU usage. I make some test and i post the results in about a hour.
Christos
blueicegr
15th November 2004, 16:37
ok finally i have find the problem.
i have a custom kernel with the option: HZ=1000 (for better handle big load and ddos).
This have make the sc server to use big cpu.
I have recompile the kernel without the option HZ=1000 (so use the default HZ=100) and now the freebsd binary runing with CPU usage 0-0.10% (same as linux binary).
So the problems is only if you use custom kernel with the HZ=1000 option (maybe with any HZ not 100).
I have test this with freebsd 4.9 and 4.10
I test and with 5.2.1 and 5.3 and i post my results (i hope it is the same).
Also can some of the users who use linux binary in freebsd change this in the kernel conf and post the results?
Regards,
Christos Pelekis
BSD admin
paz21
15th November 2004, 17:39
hmm, HZ=1000 shouldnt have that much overhead on 2.2G cpu.
also don't lower HZ if you doing traffic shaping with FreeBSD. it can have undesirable effects.
I'd rather go with different Sleep value(in sc_serv.conf) OR use linux binary.
/me can't understand why it eats alot more cpu with higher granularity when its default polling interval is 833ms
bingo
15th November 2004, 18:32
and he told to be admin.... lol :D
MegaRock
15th November 2004, 18:45
Right now I have the server loaded and pushing out a full 10 Mbps:
0.9 ./sc_serv sc_serv.conf
Less than 1 % of the CPU and that's fully in use. The server is a 1.7 g Celeron with 512 Mb RAM at 64k.
blueicegr
15th November 2004, 18:53
Originally posted by bingo
and he told to be admin.... lol :D
This is for me?
bingo
15th November 2004, 19:04
...
blueicegr
15th November 2004, 19:30
Originally posted by bingo
...
In this post i have write about a problem. The high CPU usage in freebsd servers.
The only answers i receive is "use linux binary" or "in high usage it is BSD better".
After some checks i have find that this problem happen only if you change the HZ in kernel config.
This happen at least in freebsd 4.X (tested with 4.9 and 4.10).
also the same problem have and older releases of shoutcast.
I have make a search in winamp forum but i not have see any other post about this solution. Please if you have any other post about HZ correct me.
Also i not understand why the real admins canot find this problem. and a admin who just begin with shoutcast have find this within some hours.
Regards,
Christos
P.S. I know, my English is bad. Sorry for this.
bingo
15th November 2004, 19:34
Congrates Christos. You did what was expected from a real admin (except post your troubles, lol :D)
DJ AmPs
15th November 2004, 23:10
I've had issues running shoutcast on the 2.6 kernel (fedora core 2). Lots of idle CPU usage similar to the freeBSD issue mentioned here.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.